org.mmbase.module.gui.flash
Class MMFlash

Package class diagram package MMFlash
java.lang.Object
  extended by org.mmbase.util.functions.FunctionProvider
      extended by org.mmbase.util.functions.DescribedFunctionProvider
          extended by org.mmbase.module.Module
              extended by org.mmbase.module.gui.flash.MMFlash
All Implemented Interfaces:
Descriptor

public class MMFlash
extends Module

Implements the parsing and generating of dynamic flash files

Version:
$Id: MMFlash.java 44751 2011-01-12 09:06:53Z michiel $
Author:
Johannes Verelst, Daniel Ockeloen

Field Summary
(package private)  String generatorpath
           
(package private)  String generatorprogram
           
(package private)  String generatortemppath
           
(package private) static Logger log
           
(package private)  LRUHashtable lru
           
(package private)  MMBase mmb
           
(package private)  scanparser scanp
           
(package private)  String subdir
           
 
Fields inherited from class org.mmbase.module.Module
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME
 
Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider
description, guiName, name
 
Fields inherited from class org.mmbase.util.functions.FunctionProvider
functions, getFunctions
 
Constructor Summary
MMFlash()
           
 
Method Summary
 byte[] getDebugSwt(scanpage sp)
          Return the generated flash with debug information.
 byte[] getParsedFlash(String flashXML, String workingdir)
          This function will try to generate a new flash thingie, generated from a template.
 byte[] getScanParsedFlash(scanpage sp)
          Dynamically generated flash.
 void init()
           
 void onload()
           
(package private)  String replaceQuote(String unquoted)
          Escape quotes in a string, because flash generator will fail otherwise
(package private) static boolean saveFile(String filename, byte[] value)
          Save a byte-array to disk
(package private) static boolean saveFile(String filename, String value)
          Save a stringvalue to a file on the filesystem
 
Methods inherited from class org.mmbase.module.Module
addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdown, shutdownModules, startModule, startModules
 
Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName
 
Methods inherited from class org.mmbase.util.functions.FunctionProvider
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static final Logger log

scanp

scanparser scanp

subdir

String subdir

generatortemppath

String generatortemppath

generatorpath

String generatorpath

generatorprogram

String generatorprogram

lru

LRUHashtable lru

mmb

MMBase mmb
Constructor Detail

MMFlash

public MMFlash()
Method Detail

init

public void init()
Overrides:
init in class Module

onload

public void onload()
Overrides:
onload in class Module

getDebugSwt

public byte[] getDebugSwt(scanpage sp)
Return the generated flash with debug information.

Parameters:
sp - the scanpage that includes the parameters needed to generate the flash
Returns:
array of bytes containing the flash data

getScanParsedFlash

public byte[] getScanParsedFlash(scanpage sp)
Dynamically generated flash. This method parses a xml-script and generate flash. This is done in 2 stages, first the xml is parsed through scan, the next stage will generate the flash which will then be returned.

Parameters:
sp - scanpage
Returns:
the dynamically generated flash or null when error occured

getParsedFlash

public byte[] getParsedFlash(String flashXML,
                             String workingdir)
This function will try to generate a new flash thingie, generated from a template. the only thing which has to be specified is the XML, and the working direcotory. This function was added, so that there is the possibility to use the generater from a place without SCAN

Parameters:
flashXML - a xml which contains the manipulations on the flash template
workingdir - the path where there has to be searched for the template and the other things, like pictures.(THIS LOOKS BELOW THE mmbase.htmlroot !!)
Returns:
a byte thingie, which contains the newly generated flash file

saveFile

static boolean saveFile(String filename,
                        String value)
Save a stringvalue to a file on the filesystem

Parameters:
filename - File to save the stringvalue to
value - Value to save to disk
Returns:
Boolean indicating succes

saveFile

static boolean saveFile(String filename,
                        byte[] value)
Save a byte-array to disk

Parameters:
filename - The name of the file to save the data to
value - The byte-array containing the data for the file
Returns:
Boolean indicating the success of the operation

replaceQuote

String replaceQuote(String unquoted)
Escape quotes in a string, because flash generator will fail otherwise

Parameters:
unquoted - The string with quotes (") in it
Returns:
The string where all quotes are escaped as \"


MMBase Scan 2.0-SNAPSHOT - 2013-03-30T06:50