cancel
Showing results for 
Search instead for 
Did you mean: 

Do we have any advanced Pub Sub Example

satheeshkumar
Champ in-the-making
Champ in-the-making
Hi All,

I have a requirement like, I have some filter conditions(say few date constraints and a list constraint). Upon selecting the values for these date and list constraints, then clicking on publish will invoke a POST Web Script and that POST Webscript will generate a JSON response based on the filter conditions posted.

Now I'll subscribe to this generated JSON response, iterate this response and show it in the UI,

I have gone through the pub/sub tutorial in the link below,
http://ohej.github.io/alfresco-tutorials/tutorial/aikau/tutorial.html#a-basic-pubsub-example
It gives a basic idea how pub/sub works, but I would like to know is there any kind of tutorial wihich tells how we can have date fields and list fields in the InputWidget and how can I consume these payload data in the Render widget(In the render widget once I can consume this date and list fileds which are being published form InputWidget.js, I can invoke my POST Web Script and show the rendered response).

The major challenge I face here is,
1). How to have a date fields in the InputWidget.js,
2). How to have a list field in the InputWidget.js,
3). How to pass the values associated to the above fileds to the RenderWidget.js.

Please provide some inputs/help on this.

Thanks in Advance,
4 REPLIES 4

satheeshkumar
Champ in-the-making
Champ in-the-making
Can Someone please help me on this?

ddraper
World-Class Innovator
World-Class Innovator
Have you worked through the Aikau tutorial on the GitHub project? https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Contents.md
Have you also read the blog posts on the renderFilter configuration? e.g. https://blogs.alfresco.com/wp/developer/2014/09/26/aikau-mini-examples-role-based-rendering/

Hi Dave,

Thanks for your response.
I have gone through both of them, when I was developing the stated requirement, but both of them were not suitable to my requirement.
The second one shows how to filter based on Roles,(though it dynamically shows/hides based on roles), the static part here is the Group that we configure, so only for the group that we configure in the widget if the user is part of that group(mentioned in the widget), the widget will be shown/hidden based on the logic wrote in that widget.

My requirement was slightly different,
in my case, the configuration filter itself is dynamic, (example, I have a filter condition say last Deployed Date to QA)

Say I have written a web-script, which uses JS Controller, and in that controller I have written a widget using AlfListView and a filter condition using a AlfButton which just publishes "ALF_CREATE_DIALOG_REQUREST" that dialog will have a widget to key in last deployed to QA Date, and the data for that AlfListView comes as a JSON response  from the Alfresco Webscript,
now initially when I invoke this web-script(which has AlfListView widget configuration in place), I should not show any data to the user, when the user clicks on the AlfButton and gives the input for the QA Date field, the data should be posted to the Alfresco Webscript that will inturn send me a filtered response, now I want use this as a response iterate and show it in the UI using AlfListView.

I have several filtered condition, my java-backed alfresco webscript will take care of generating the Json Response based on the filter conditions.
My only concern here is how to have the filtered JSON response and show it in UI.

Please let me know if don't make things clear.

ddraper
World-Class Innovator
World-Class Innovator
It sounds like "visibilityConfig" is what you're looking for, see: https://blogs.alfresco.com/wp/developer/2014/10/28/aikau-updates-to-dynamic-visibility-config/

We use this to control widgets being revealed and hidden on a variety of publications.