<FILE> : Path to a file field

Java class : leon.info.LyFileFieldInfo

ROLE

This element defines a field that contains the path to a file. An attribute enables to define MIME types that are allowed for the files of this field. Information about that kind of field could be completed by the path to the default file.

ATTRIBUTES

<!ATTLIST FILE
	  id ID #REQUIRED
	  template IDREF #IMPLIED
	  javaName NMTOKEN #IMPLIED
	  attachmentDirectory CDATA "files"
	  attachmentHandler CDATA #IMPLIED
	  mimeTypes CDATA #IMPLIED
	  directory CDATA #IMPLIED
	  filter CDATA #IMPLIED
	  behavior NMTOKEN #IMPLIED>
Attribute Mand. Description Default
id yes This is the identifier of this field.  
template no Reference to the relation field used as pattern.  
javaName no Name of the Java attribute that corresponds to the current field when automatic code generation is used. The default value is the name of the current field.  
attachmentDirectory no This attribute specifies the directory where files are stored on server. files
attachmentHandler no This attribute specifies a class to manage file submission in forms. When this parameter is set, the form does not send only the file name, but also the content of the file and the specified class stores it on server side. (thin client only implementation) Default value is null, which means that this feature is deactivated. Possible values are 'default for generic file encoder, which is equivalent to leon.view.web.LyFileAttachmentHandler, or a specific implementation.  
mimeTypes no List of MIME types allowed for this file. Only 'image' type and type 'text/x-url' are recognized.  
directory no Directory from which search of files is done. If a file is chosen in a sub-directory of directory, the value is relative to this directory (its value doesn't contain the directory part).  
filter no Filter for searched
files (example: "*.doc")
 
behavior no Name of the Java class representing the behavior of this field. Reserved for a future use.  

ELEMENTS

<!ELEMENT FILE 
	  (%FIELD_BEGIN;,
	   NROWS?,
	   NCOLS?,
	   DEFAULT?,
	   %FIELD_END;)>
Element Mand. Mult. Description
FIELD_BEGIN
yes no Begin of a field description.
NROWS no no Width of the image in number of pixels.
NCOLS no no Height of the image in number of pixels.
DEFAULT no no Path to the default file.
FIELD_END
yes no End of a field description.

SAMPLE

<FILE id="user_photo" mimeType='image' directory="$MY_IMAGES_DIR" 			
		filter="*.gif">
	<F_BIND value="PHOTO"/>
	<NAME value="USER_PHOTO"/>
	<NROWS value="100"/>
	<NCOLS value="100"/>
	<F_MARKS create='true' set='true'/>
</FILE>