This class is the communication unit of SILEX : communication with php, javascript, mySql. In the repository : /trunk/core/Com.as @class Com
1
Alexandre Hoyau
| org. | This class is the communication unit of SILEX : communication with php, javascript, mySql. |
| Variables | |
| silex_ptr | reference to silex main Api object (org.silex.core.Api) |
| connection | the service object we use to call serverside php methods (with amfPhp) |
| Properties | |
| gatewayUrl | URL of the amfPhp gateway. |
| Variables | |
| fscommandSupport_bool | Is fscommand supported by the host? |
| Functions | |
| Com | Constructor. |
| getDynData | Call getDynData webservice and returns these data: - constants: langage, ... |
| writeWebsiteConfig | Call writeWebsiteConfig webservice to write into a website config file or to create a website. |
| duplicateWebsite | Duplicates a website. |
| listToolsFolderContent | Called by org.silex.ui.ToolsManager. |
| listFtpFolderContent | Called by toolbox.Library. |
| writeSectionData | Called by org.silex.core.Application.save. |
| regenerateWebsiteIndex | Start the indexation process on the server. |
| getLatestSilexVersion | Retrieve the last available version of SILEX. |
| initJsCom | fscommand support detection. |
| jsCall | Call this function to execute javascript code. |
| jsWindowStatus | Display something in the browser status bar. |
| silexOnStatus | Call the javascript onStatus loginSuccess { type:”loginSuccess”,login:login_str} logout loginError { type:”loginError”,fault:fault.fault.faultstring,message:silex_ptr.config.MESSAGE_AUTH_FAILD} |
public function getDynData( websiteInfo: Object, filesList: Array, callback: Function )
Call getDynData webservice and returns these data: - constants: langage, ... - dynamic data from a module - website data: layout, content folder, media folder - files to preload
| param | websiteInfo an object containing any properties to be passed to the webservice in order to retrieve the desired data. websiteInfo has to contain at least “id_site” property set to the website name. |
| param | filesList an array of file names to be retrieved |
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which is an array of objects, one object for each file which contains key/value pairs. |
public function writeWebsiteConfig( websiteInfo: Object, id_site: String, callback: Function )
Call writeWebsiteConfig webservice to write into a website config file or to create a website.
| param | websiteInfo an object containing any properties to be passed to the webservice - if empty, delete the website from the server (move it in the trash/ folder ). |
| param | id_site the website name. |
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which is a boolean : the success state of the operation server side. |
public function duplicateWebsite( id_site: String, newName_str: String, callback: Function )
Duplicates a website. The whole website folder is duplicated in contents/.
| param | id_site the website name. |
| param | newName_str the new website name. |
| param | callback a function which will be called once the operation is done. This function has to receive 1 parameter which a string : empty if everything is ok or the error message of the server side operation, or null if a network error occured. |
function listToolsFolderContent( relativePath: String, callback: Function )
Called by org.silex.ui.ToolsManager. Lists the tools folder.
| param | relativePath the path of the folder to be listed, starting from the tools/ folder |
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which an array of objects. Each object has the following properties : item type a string, either file or folder item size a number of bytes, result of the php function filesize item readable size a string, formated file size (e.g. “50 Ko”) item name the file name item last modification date last modification date of the file (“Y-m-d\H:i:s”) item width only if the file is a jpg image item height only if the file is a jpg image itemContent an array of objects of the same type: recursive process - only for folders (items with type set to “folder”) |
function listFtpFolderContent( relativePath: String, callback: Function )
Called by toolbox.Library.
| param | relativePath the path of the folder to be listed, starting from the tools/ folder |
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which an array of objects. Each object has the following properties : item type a string, either file or folder item size a number of bytes, result of the php function filesize item readable size a string, formated file size (e.g. “50 Ko”) item name the file name item last modification date last modification date of the file (“Y-m-d\H:i:s”) item width only if the file is a jpg image item height only if the file is a jpg image itemContent an array of objects of the same type: recursive process - only for folders (items with type set to “folder”) |
function writeSectionData( xmlData: String, xmlFileName: String, sectionName: String, seoData_obj: Object, callback: Function, domObject: Object )
Called by org.silex.core.Application.save. Write data to a file - could be a db. The data corresponds to a section, i.e. a page with a deeplink.
| param | xmlData the data to be stored - if empty, delete the section from the server. |
| param | xmlFileName the file name or record id, a clean version of sectionName |
| param | sectionName the section name |
| param | seoData_obj object with key/value pairs to be stored in the index, i.e. searchable data |
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which is a string : empty if everything is ok or the error message of the server side operation |
function regenerateWebsiteIndex( callback: Function )
Start the indexation process on the server.
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which is the number of media indexed. |
function getLatestSilexVersion( callback: Function )
Retrieve the last available version of SILEX. Called by tools manager.
| param | callback a function which will be called with the resulting data or null if an error occured. This function has to receive 1 parameter which is a string: the latest stable version available. |
reference to silex main Api object (org.silex.core.Api)
private var silex_ptr: org.silex.core.Api
the service object we use to call serverside php methods (with amfPhp)
public var connection: NetConnection
URL of the amfPhp gateway.
function get gatewayUrl():String
Is fscommand supported by the host?
public var fscommandSupport_bool: Boolean
Constructor.
function Com( api: org.silex.core.Api )
Call getDynData webservice and returns these data: - constants: langage, ...
public function getDynData( websiteInfo: Object, filesList: Array, callback: Function )
Call writeWebsiteConfig webservice to write into a website config file or to create a website.
public function writeWebsiteConfig( websiteInfo: Object, id_site: String, callback: Function )
Duplicates a website.
public function duplicateWebsite( id_site: String, newName_str: String, callback: Function )
Called by org.silex.ui.ToolsManager.
function listToolsFolderContent( relativePath: String, callback: Function )
Called by toolbox.Library.
function listFtpFolderContent( relativePath: String, callback: Function )
Called by org.silex.core.Application.save.
function writeSectionData( xmlData: String, xmlFileName: String, sectionName: String, seoData_obj: Object, callback: Function, domObject: Object )
Start the indexation process on the server.
function regenerateWebsiteIndex( callback: Function )
Retrieve the last available version of SILEX.
function getLatestSilexVersion( callback: Function )
fscommand support detection.
public function initJsCom()
Call this function to execute javascript code.
public function jsCall( commande_str )
Display something in the browser status bar.
public function jsWindowStatus( etat_str: String )
Call the javascript onStatus loginSuccess { type:”loginSuccess”,login:login_str} logout loginError { type:”loginError”,fault:fault.fault.faultstring,message:silex_ptr.config.MESSAGE_AUTH_FAILD}
public function silexOnStatus( event: Object )