Flash and xml problem

Author Message

Christophe DEMOIRE

Thursday 10 August 2006 3:40:05 am

Hello,

I have a flash file based on a xml file (Menu.xml) which creates a menu. Without ezpublish that works very well.
In the .tpl I put:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="830" height="40" id="Menu" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value={"images/menu.swf"|ezdesign} />
<param name="quality" value="high" /><param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src={"images/menu.swf"|ezdesign} quality="high" wmode="transparent" bgcolor="#ffffff" width="830" height="40" name="Menu" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

But nothing made there, it wants to take into account the xml...
I have already put the xml file in different place:
- the ezpublish root directory
- the images directory
- the design directory
- etc...

A desperate man.

I already cleared the cache!

Patrick Kaiser

Thursday 10 August 2006 5:15:13 am

you most probably have to alter your apache rewrite rule in order to allow access to .xml documents. to do so add a line like this in your vhost configuration:

RewriteEngine On
RewriteRule ^/(.*)(\.)xml - [L]
.. further rules here ..

In case you want to use information that is available within ez publish (e.g. node-names, text, images) in flash the better solution would be if you create a flash specific template, that fetches the relevant content and than outputs the plain xml. you could also define a new xml layout template in layout.ini.append.php und call it via http://[yourhost]/layout/set/[yourxmllayout]/content/view/full/[node_id].

regards, patrick


Best regards,

Patrick

Christophe DEMOIRE

Thursday 10 August 2006 5:58:55 am

Hi Patrick,

I dont't understand why use rewrite rules. The flash menu works in a html file. But, when I put it in my eZ templates, it doesn't work anyway.
The flash file require a xml file called "Menu.xml" wich is in the same directory. I cannot specify the path to the Menu.xml.

I think eZ publish don't load the xml file, or in a inccorect place.

I already cleared the cache!

Patrick Kaiser

Thursday 10 August 2006 9:57:28 am

If you installed ez publish according to the manual you have either created a dedicated virtual host for your ez publish site that contains some rewrite rules or you use an .htaccess file that contains theese rewrite rules. the standard rules prevent apache to deliver certain types of documents as for example .xml-files. if you request for example http://yoursite/menu.xml the rewrite rule prevent apache from delivering it, instead the request /menu.xml will be rewritten to the index.php which will cause ez publish to lookup menu.xml what will result in a 'module not found' error.

You see, the reason why flash cant use your xml-file is a rewrite rule.

if you use the standard .htaccess file you have to add 'xml' somewhere between the first '()'-group:

RewriteEngine On
RewriteRule !\.(gif|jpe?g|png|css|js|html|xml)|var(.+)storage.pdf(.+)\.pdf$ index.php

if you have a virtual host based setup you can add the rewrite rule from my previous post..

best regards, patrick


Best regards,

Patrick

Brian Gambill

Thursday 10 August 2006 5:29:58 pm

I had a similar problem trying to pull in external swf files. I was able to solve it using the "base" parameter.

See http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_04157.

<PARAM NAME="BASE" VALUE="http://www.domainname.com/software">

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:38:29
Script start
Timing: Jan 18 2025 11:38:29
Module start 'layout'
Timing: Jan 18 2025 11:38:29
Module start 'content'
Timing: Jan 18 2025 11:38:30
Module end 'content'
Timing: Jan 18 2025 11:38:30
Script end

Main resources:

Total runtime1.0609 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.0234152.6250
Module start 'layout' 0.00680.0026 741.648439.4453
Module start 'content' 0.00941.0493 781.0938610.7266
Module end 'content' 1.05870.0020 1,391.820316.1719
Script end 1.0608  1,407.9922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2936160.0002
Check MTime0.00130.1204160.0001
Mysql Total
Database connection0.00100.091710.0010
Mysqli_queries0.988593.1743650.0152
Looping result0.00080.0761630.0000
Template Total1.019596.120.5098
Template load0.00230.218920.0012
Template processing1.017295.879820.5086
Template load and register function0.00010.011010.0001
states
state_id_array0.00240.226510.0024
state_identifier_array0.00120.109820.0006
Override
Cache load0.00190.1759390.0000
Sytem overhead
Fetch class attribute can translate value0.00080.076730.0003
Fetch class attribute name0.00170.157670.0002
XML
Image XML parsing0.00120.112030.0004
class_abstraction
Instantiating content class attribute0.00010.005390.0000
General
dbfile0.00190.1774220.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs