cancel
Showing results for 
Search instead for 
Did you mean: 

how to embed Alfresco document in external site?

hoaivan
Champ in-the-making
Champ in-the-making
Hi everybody,

Assume that i let Guest access to my document. Is there any feature that allow me to make a copy of an 'embeddable script' then paste into external site. Then visitor can view the document immediately. Just like youtube's embed script. If not, please guide me to develop that feature.

Thank you in advance.
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Just stick the document's URL on your external site.

mikeh
Star Contributor
Star Contributor
I realise you've posted this in the Alfresco Explorer forum, but you can embed the Share WebPreviewer with code along the lines of:
<embed type="application/x-shockwave-flash"   src="http://<server>:<port>/share/components/preview/WebPreviewer.swf"   width="670px"   height="670px"   id="WebPreviewer"   name="WebPreviewer"   quality="high"   allowscriptaccess="sameDomain"   allowfullscreen="true"   wmode="transparent"   flashvars="fileName=aaar.png&amp;paging=false&amp;url=http%3A%2F%2Flocalhost%3A8080%2Falfresco%2Fservice%2Fapi%2Fnode%2Fworkspace%2FSpacesStore%2F15ddb4a8-63a5-4bf3-95a8-4d121d2eaed2%2Fcontent%3Fc%3Dforce%26noCacheToken%3D1257980553515%26guest%3Dtrue&amp;show_fullscreen_button=true&amp;i18n_actualSize=Actual%20Size&amp;i18n_fitPage=Fit%20Page&amp;i18n_fitWidth=Fit%20Width&amp;i18n_fitHeight=Fit%20Height&amp;i18n_fullscreen=Fullscreen&amp;i18n_fullwindow=Maximize&amp;i18n_fullwindow_escape=Press%20Esc%20to%20exit%20full%20window%20mode&amp;i18n_page=Page&amp;i18n_pageOf=of" />‍‍‍‍‍‍‍‍‍‍‍
Note the flashvars variable is a string passed through "encodeURIComponent" consisting of the following variables:
fileName=aaar.pngpaging=falseurl=http://localhost:8080/alfresco/service/api/node/workspace/SpacesStore/15ddb4a8-63a5-4bf3-95a8-4d121d...show_fullscreen_button=truei18n_actualSize=Actual Sizei18n_fitPage=Fit Pagei18n_fitWidth=Fit Widthi18n_fitHeight=Fit Heighti18n_fullscreen=Fullscreeni18n_fullwindow=Maximizei18n_fullwindow_escape=Press Esc to exit full window modei18n_page=Pagei18n_pageOf=of"‍‍‍‍‍‍‍‍‍‍‍‍‍
Note the noCacheToken on the end of the "url" variable to ensure your users are always viewing the latest content. It's up to you whether you generate this value or not.

The i18n messages make the tag somewhat unwieldy, so there's a (completely unsupported and not fully tested) version of the WebPreviewer.swf that has the English strings built-in by default here: http://mikehatfield-alfresco.s3.amazonaws.com/WebPreviewer.swf.zip
<embed type="application/x-shockwave-flash"   src="http://<server>:<port>/share/components/preview/WebPreviewer.swf"   width="670px"   height="670px"   id="WebPreviewer"   name="WebPreviewer"   quality="high"   allowscriptaccess="sameDomain"   allowfullscreen="true"   wmode="transparent"   flashvars="fileName=aaar.png&amp;paging=false&amp;url=http%3A%2F%2Flocalhost%3A8080%2Falfresco%2Fservice%2Fapi%2Fnode%2Fworkspace%2FSpacesStore%2F15ddb4a8-63a5-4bf3-95a8-4d121d2eaed2%2Fcontent%3Fc%3Dforce%26noCacheToken%3D1257980553515%26guest%3Dtrue&amp;show_fullscreen_button=true" />‍‍‍‍‍‍‍‍‍‍‍

Thanks,
Mike