cancel
Showing results for 
Search instead for 
Did you mean: 

Messaging Api?

jsauer
Champ in-the-making
Champ in-the-making
Hi,
I wonder how one can propagate messages from Java/JavaScript code up to the Share UI?

In the old Web-Explorer there is FacesMessage and FacesContext.addMessage to do this. Up to now it seems that all this messages do not propagate to the Share UI  :cry:

I am currently struggeling with behaviours and it's messaging (see my other posts at the Repository Services forum) and I just get "The copy could not be completed" as an error message but neither the exception information that this is due to a policy bound behaviour neither the message I propagate to the Web-Explorer by means of FacesContext.addMessage.

If I just misssed something, sorry about that, and thanks for hints where to look at.

If there is nothing yet, I would highly suggest that something should be done to address this:
Common messaging API
1. propagate to Web-Explorer
2. propagate to Share
3. Hooks to subscribe messages by other components.

Any comments?
Thanks
Jörg
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
If you mean responses from REST APIs, then it's up to the client code to use the client-side JavaScript helper functions to display a message to the user, depending on the contents of the response. Look at the Alfresco.util.PopupManager class in alfresco.js within Share.

Remember that Share is a separate web application to the Repository & Explorer clients, therefore the idea of "propagating messages" in a common way doesn't apply.

Thanks,
Mike

jsauer
Champ in-the-making
Champ in-the-making
Hi Mike,
Remember that Share is a separate web application to the Repository & Explorer clients, therefore the idea of "propagating messages" in a common way doesn't apply.

I disagree on this one! Of cource Share is a separate application. But it is tightly coupled to the Alfresco Repository and the Document Library is an integral part of it. Besides the full integration of the repository into Share is on your roadmap and sheduled for 3.3 as I learned in the November Meetup in Frankfurt, Germany. And it was made public in the Meetups in the States as well, as far as the Blog of Jeff Potts states if not mistaken.

Lot's of things are done within the repository automaticall by means of behaviours, rules and stuff. If Share is to be seen as a separate, independent product how come Explorer Client to be an integral part of Repository? As far as I know Alfresco is not going to put much development into the Explorer client anymore but shifts its focus on Share to become the future main web-frontend for Alfresco.

If errors and messages generated at the Repository level just make it into the "old" Explorer client I think the user will be left in the dark if he just uses Share. And me as developer, how should I figure out what went wrong respective was the cause for not being able to copy a document for example. There is no way to query the Repository Service for the cause, is there? Neither the Java API nor the JavaScript API provides an interface for this.

Currently the Explorer client get's signaled if an exeption was thrown or a Faces-Message had been generated. From the error messages genereted by throw the user can somehow figure out what was the cause. Not a nice error message but some times usefull. If the user just gets "The copy could not be completed" he is totally lost, as is the user help desk which will get the call. They would have to replay the actions of the user and monitor the log to see what's going on and then relax as they found out copying was just being prevented by a behaviour on purpose.

So I do see the necessity for a messaging service/API which propagates messages to the UI used to make the call. I do not think this will be an easy task to do but I feel lost if I do not know how to figure out what went wrong.

If the copy call in the API would provide the reason of the failure in some way, of course one as a developer could made it being displayed in the UI easily. But up to now …

Thanks
Jörg