cancel
Showing results for 
Search instead for 
Did you mean: 

Using Alfresco Share javascript functions from Aikau

daforce93
Champ in-the-making
Champ in-the-making
Hi everyone,

This question is more about Aikau than Share, but there wasn't a dedicated Aikau forum (that I could see), so I figured this would be the best place to post this question.

Anyway, in my local Alfresco Share installation, there's an action for MS Word, PowerPoint, and Excel documents, called "Edit Online". Here's a screenshot of what I'm talking about:

[img=640x480]https://s32.postimg.org/69wn9su3p/edit_online.png[/img]

Clicking on "edit online" causes MS Word to open. As far as I can tell, this is done by making the browser open a link of the following form:


ms-wordSmiley Surprisedfe%7Cu%7C Link to document


I'm trying to replicate this action in Aikau. I installed and set-up Aikau according to the tutorial on Github (https://github.com/Alfresco/Aikau/blob/master/tutorial/chapters/Tutorial1.md). There's a javascript file in Alfresco installation/tomcat/webapps/share/components/documentlibrary called actions.js, and I'm pretty sure that the function called onActionEditOnline is what causes MS Word/Powerpoint/Excel to launch.

Additionally, if I open up a Javascript console while in Share, there's a function with the path "Alfresco.doclib.Actions.prototype.onActionEditOnline":

[img=640x480]https://s31.postimg.org/xav4017cr/share.png[/img]

I think this is the function from actions.js

However, when I open a Javascript console from Aikau, there is no such function. However, there is an "Alfresco" object, albeit with only two properties:

[img=640x480]https://s31.postimg.org/dmbqjn0xn/aikau.png[/img]


Is there a way to use this javascript function, located in actions.js, from Aikau?

Thanks,

Jordan
1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator
Hello,

the onActionEditOnline function is part of the YUI-based document library components that will not be loaded in Aikau-based pages. You could technically include it manually, but bridging the Aikau-YUI divide can be quite a challenge especially given the dependencies that the YUI components bring in terms of event handling, expected data formats etc. It would be better to use a proper Aikau-based edit online functionality as part of a client-side service.
I have written such a service with edit online functionality in one of my recent projects. Unfortunately code ownership lies with the customer so I can't readily share the code…

Regards
Axel

View answer in original post

4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

the onActionEditOnline function is part of the YUI-based document library components that will not be loaded in Aikau-based pages. You could technically include it manually, but bridging the Aikau-YUI divide can be quite a challenge especially given the dependencies that the YUI components bring in terms of event handling, expected data formats etc. It would be better to use a proper Aikau-based edit online functionality as part of a client-side service.
I have written such a service with edit online functionality in one of my recent projects. Unfortunately code ownership lies with the customer so I can't readily share the code…

Regards
Axel

daforce93
Champ in-the-making
Champ in-the-making
Thanks! What do you mean by "proper Aikau-based edit online functionality"?

afaust
Legendary Innovator
Legendary Innovator
I mean writing an Aikau service that handles edit online functionality instead of trying to wrangle an existing, but largely incompatible construct (YUI document library function for edit online) in there.

ddraper
World-Class Innovator
World-Class Innovator

We have been in the process of working through porting the remaining Document Library actions to Aikau, and the Edit Online action is one of these. This epic lists all the action issues, this would be the most relevant issue

The Aikau team is a component (rather than feature) team and delivers requirement made by other feature teams. Because no feature team have required the edit online action we haven't implemented it yet.

We did actually take a look at this action during a couple of sprints, but it remains unfinished. If there is sufficient demand from the community to implement this action (before there is demand from within the Alfresco feature teams) then we will implement this.