cancel
Showing results for 
Search instead for 
Did you mean: 

Document preview problem with Joomla

alexmackr
Champ in-the-making
Champ in-the-making
I have installed the Alfresco Labs version 3, I can see the names of the documents from my space Alfresco joomla but I can only see a preview, black box
14 REPLIES 14

bastienfan
Champ in-the-making
Champ in-the-making
Hello,

I have the same bug.

ardesign
Champ in-the-making
Champ in-the-making
Same here.

Not sure if it's a bug or something I'm doing wrong, but any help or pointers towards solving it would be appreciated

ofrxnz
Champ in-the-making
Champ in-the-making
I think i found it. 

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

ofrxnz
Champ in-the-making
Champ in-the-making
I have some more progress,

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

cbosner
Champ in-the-making
Champ in-the-making
came across this thread after figuring out the

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]

ofrxnz
Champ in-the-making
Champ in-the-making
I just posted some code in the following thread
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

ofrxnz
Champ in-the-making
Champ in-the-making
Oh, on the same note i have it working in IE as well….I had to make a couple of changes to things in Share's to get the Alf_Ticket to work….one of those may have also fixed the IE

if you want some of the other changes i made let me know and ill post them when i get to work tomorrow

cbosner
Champ in-the-making
Champ in-the-making
I appreciate the help man.  If you could post your other changes, that would be cool

Thanks again.

ofrxnz
Champ in-the-making
Champ in-the-making
in share, in the web-preview.js file try playing with this section of code

               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)