Cmobilecom AF 5.19 Developer Guide

Embedded Objects - FTP

Embedded FTP uses HTTP to list and transfer files on server side. Access control is supported for file or directory listing, creation, deletion, upload and download.

If user does not have permission for a certain action, the function will not be available, or open a login dialog for user to login.

For example, list zip files under #{dataAccessUnit.home}/www/download. The list of files is open to public, but file download requires user to login, and other actions(file upload, delete files, list/create/delete dir) require user to login as a system user and have the permission: Website.ManageWS.


	<object xmlns="http://www.cmobilecom.com/af/objects"
			id="ftp1" type="ftp">
		<docBase>#{dataAccessUnit.home}/www/download</docBase>
		<pattern>.*\.zip$</pattern>
		<descriptionBundle>README</descriptionBundle>

		<viewConfig>
			<accessControl module="FTP">
				<action name="listFiles" accessControl="PUBLIC" />
				<action name="upload" accessControl="SUSER{Website.ManageWS}" />
				<action name="download" accessControl="USER" />
				<action name="deleteFiles" accessControl="SUSER{Website.ManageWS}" />

				<action name="listDir" accessControl="SUSER{Website.ManageWS}" />
				<action name="createDir" accessControl="SUSER{Website.ManageWS}" />
				<action name="deleteDir" accessControl="SUSER{Website.ManageWS}" />
			</accessControl>
		</viewConfig>
	</object>
The description resource bundles are the same as Java resource bundle properties. locale fallback is supported. For example,
	file1.zip 
	file2.txt
	file3.xml
	dir3
	README.properties
	README_fr.properties
	README_zh.properties
In the resource bundle properties, keys are file or directory names, and values are the descriptions of the files or directories for the locale. For example, README.properties
	file1.zip=File One is a Zip file
	file2.txt=File Two is a text file
	file3.xml=File Three is a xml file
	dir3=dir3 is a directory
File or directory descriptions will be shown in the description column of file listing.

For access control configuration XML, see Access Control.

Embedded Objects: LoginEmbedded Objects: Slide ShowFrames / No Frames