Document preview problem with Joomla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 02:12 PM
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2009 03:04 AM
I have the same bug.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 06:38 AM
Not sure if it's a bug or something I'm doing wrong, but any help or pointers towards solving it would be appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 01:18 PM
The preview includes a file from share. This file seems to have changed name.
here is something i noted in another post
In default_preview_flash.php here are some lines that seem to be for an older version of alfresco.
$document->addScript($this->profile->share.'/yui/selector/selector-beta-min.jss');
is miss typed and should be ".js" at the end not ".jss" as seen below
$document->addScript($this->profile->share.'/yui/selector/selector-beta-min.jss');
The following files dont exist. There is a new script and css in that folder but their is only one not two
// Document Preview $document->addStylesheet($this->profile->share.'/components/preview/preview.css'); $document->addScript($this->profile->share.'/components/preview/preview.js'); $document->addStylesheet($this->profile->share.'/components/preview/full-preview.css'); $document->addScript($this->profile->share.'/components/preview/full-preview.js');
finding the right replacement for these last four should hopefully fix the preview issue. they are in share under the http:\\<server><port>\share\components\preview folder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2009 02:23 PM
These are the required dependencies from share
$document->addStylesheet($this->profile->share.'/components/preview/web-preview.css');$document->addScript($this->profile->share.'/components/preview/web-preview.js');$document->addStylesheet($this->profile->share.'/components/preview/WebPreviewer.css');
Then the script initiation needs to be changed to
<script type="text/javascript">//<![CDATA[new Alfresco.WebPreview("document-details").setOptions({…
the key change is new Alfresco.Preview needs to become "new Alfresco.WebPreview"
The instantiation is still off so it is not previewing anything but, the preview flash applet is still loading.
It would be great if someone knew how this call needed to be changed
<script type="text/javascript">//<![CDATA[new Alfresco.WebPreview("document-details").setOptions({ nodeRef: 'workspace://SpacesStore/<?php echo $this->file->uuid ?>', name: '<?php echo $this->file->name ?>', icon: '/components/images/generic-file-32.png', mimeType: '<?php echo $this->file->content_type ?>', previews: <?php echo json_encode($this->thumbnail->definitions) ?>}).setMessages( {"label.currentFrame": "Page <b>{0}<\/b> of <b>{1}<\/b>", "button.next": "Next", "header.previewDocument": "Preview of {0}", "error.contentNotAVM2MovieClip": "The preview cannot be displayed since its not a AVM2 movie clip", "label.noFlash": "To view the preview please download the latest Flash Player from the<br\/> <a href=\"http:\/\/www.adobe.com\/go\/getflashplayer\">Adobe Flash Player Download Center<\/a>.", "label.jumpToPage": "Jump to page:", "label.noPreview": "This document can't be previewed.<br\/>Click <a href=\"{0}\">here<\/a> to download it.", "button.fullPreview": "Full Screen", "message.invalidFrame": "You must enter a frame between {0} and {1}", "error.server": "The preview cannot be displayed due to a server error", "button.previous": "Prev"} );//]]></script>
thanks,
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2009 10:41 AM
the key change is new Alfresco.Preview needs to become "new Alfresco.WebPreview"
Now it's loading in Firefox (albeit not quite correctly) but not in IE. Has anybody made progress on this? Thanks
FF:
[img]http://i146.photobucket.com/albums/r252/cbosner/misc/alfresco_ss2.png[/img]
IE:
[img]http://i146.photobucket.com/albums/r252/cbosner/misc/alfresco_ss3.png[/img]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2009 04:27 PM
http://forums.alfresco.com/en/viewtopic.php?f=49&t=18426&p=62023#p62023
it should get the file page to a usable state. I still had to tweak the plugin's CSS file to get it to play friendly on my site (ul li and what not).
happy hunting.
Adam
if you want a pic, ill email one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2009 05:37 PM
if you want some of the other changes i made let me know and ill post them when i get to work tomorrow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2009 05:51 PM
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2009 08:40 AM
var so = new deconcept.SWFObject(Alfresco.constants.URL_CONTEXT + "/components/preview/WebPreviewer.swf","WebPreviewer", "100%", "670", "9.0.45"); so.addVariable("fileName", this.options.name); so.addVariable("paging", previewCtx.paging); so.addVariable("url", escape(previewCtx.url)); so.addVariable("jsCallback", "Alfresco.util.ComponentManager.find({id:'" + this.id + "'})[0].onWebPreviewerEvent"); so.addParam("allowScriptAccess", "always"); //so.addParam("allowScriptAccess", "sameDomain"); so.addParam("allowFullScreen", "true"); so.addParam("wmode", "transparent"); so.write(this.id + "-swfPlayer-div");
about my changes
My test lamp stack and test alfresco stack are two seperate boxes so i had to loosen the security on this. i bet this leaves me open for a cross site scripting so probably should change it back for production and have both servers on the same box.
so.addParam("allowScriptAccess", "always");
and
I had some character encoding issues while feeding my URLs to the flash. this should properly encode characters. the one that particularly gave me grief was the & character. MikeH (Alfresco Engineer) helped me find this one by suggesting i use fiddler as a proxy to see what the requests are and i found truncation issues between the JS and the Flash. This code change rectified it. That post is somewhere in this board
so.addVariable("url", escape(previewCtx.url));
aside from those two, every other change i made was to get indivigual user authentication working instead of a generic account.
one thing to do is to go to a document preview page in Share, view the source, then go to your document preview in joomla and also get the source. go line by line and make sure all your includes and variables correct.
the other code i posted should correct the includes and formatting. (or at least it looks great for me)
