cancel
Showing results for 
Search instead for 
Did you mean: 

Document Preview configuration with webscript

bilalsaeed
Confirmed Champ
Confirmed Champ
I have a javscript based webscript using which user can upload files, create folders and retrieve uploaded files and their respective metadata. Now I want to enable a functionality for user to preview the uploaded files in Document Preview Pane of share console. Unfortunately I couldn't able to find any builtin webscript in alfresco console( <a>http://172.20.3.63:8080/alfresco/s/index</a>). Or any javascript api. I did able to find webscript in share console( <a>http://http://172.20.3.63:8080/share/page/index </a>)
<a>http://http://172.20.3.63:8080/share/page/components/preview/web-preview?nodeRef=workspace://SpacesS...</a> But result is a blank webpage. I want to allow user to preview the file based on the authentication of my webscript which is based on alfresco ticket.

Any suggestion to achieve aforementioned functionality? Thanks in advance and my apology for such a basic topic as I am a newbie in Alfresco.
1 ACCEPTED ANSWER

ddraper
World-Class Innovator
World-Class Innovator

This use case is something that would be easy to implement as an Aikau page in Share... you've said you want to create a WebScript though, rather than a page - is there a particular reason for this? How are you hoping for your end users to access this new feature?

Generating previews is really simple with Aikau as all you need is the "nodeRef" of the content you want to preview. There is an AlfDocumentPreview widget you can use which is demostrated on the Aikau Sandpit.

There is also some useful information on the Aikau tutorial on GitHub in how you can use this widget... in fact, working through the tutorial will give you a good idea of how to create pages for Share using Aikau.

You can use the doclib.lib.js import file to help you build as much or as little of a Document Library to viewing and uploading the content. 

I'd recommend that you work through the tutorial (or at least read through it) and then have a go and using the DocLib import - if you have any questions then please add follow up questions here or start a new thread.

View answer in original post

1 REPLY 1

ddraper
World-Class Innovator
World-Class Innovator

This use case is something that would be easy to implement as an Aikau page in Share... you've said you want to create a WebScript though, rather than a page - is there a particular reason for this? How are you hoping for your end users to access this new feature?

Generating previews is really simple with Aikau as all you need is the "nodeRef" of the content you want to preview. There is an AlfDocumentPreview widget you can use which is demostrated on the Aikau Sandpit.

There is also some useful information on the Aikau tutorial on GitHub in how you can use this widget... in fact, working through the tutorial will give you a good idea of how to create pages for Share using Aikau.

You can use the doclib.lib.js import file to help you build as much or as little of a Document Library to viewing and uploading the content. 

I'd recommend that you work through the tutorial (or at least read through it) and then have a go and using the DocLib import - if you have any questions then please add follow up questions here or start a new thread.