Changeset 3762
- Timestamp:
- Sep 21, 2007, 9:18:07 AM (16 years ago)
- Location:
- trunk/doc/src/docbook
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/src/docbook/developerdoc/api_overview.xml
r3757 r3762 649 649 <sect2 id="data_api.files"> 650 650 <title>Files and directories</title> 651 652 <para> 653 This section covers the details of the BASE file 654 system. 655 </para> 656 657 <sect3 id="data_api.files.uml"> 658 <title>UML diagram</title> 659 660 <figure id="data_api.figures.files"> 661 <title>Files and directories</title> 662 <screenshot> 663 <mediaobject> 664 <imageobject> 665 <imagedata 666 fileref="figures/uml/datalayer.files.png" format="PNG" /> 667 </imageobject> 668 </mediaobject> 669 </screenshot> 670 </figure> 671 </sect3> 672 673 <sect3 id="data_api.files.description"> 674 <title>Description</title> 675 676 <para> 677 The <classname>DirectoryData</classname> class holds 678 information about directories. Directories are organised in the 679 ususal way as as tree structure. All directories must have 680 a parent directory, except the system-defined root directory. 681 </para> 682 683 <para> 684 The <classname>FileData</classname> class holds information about 685 a file. The actual file contents is stored on disk in the directory 686 specified by the <varname>userfiles</varname> setting in 687 <filename>base.config</filename>. The <varname>internalName</varname> 688 property is the name of the file on disk, but this is never exposed to 689 client applications. The filenames and directories 690 on the disk doesn't correspond to the the filenames and directories in 691 BASE. 692 </para> 693 694 <para> 695 The <varname>location</varname> property can take three values: 696 </para> 697 698 <itemizedlist> 699 <listitem> 700 <para> 701 0 = The file is offline, ie. there is no file on the disk 702 </para> 703 </listitem> 704 <listitem> 705 <para> 706 1 = The file is in primary storage, ie. it is located on the disk 707 and can be used by BASE 708 </para> 709 </listitem> 710 <listitem> 711 <para> 712 2 = The file is in secondary storage, ie. it has been moved to some 713 other place and can't be used by BASE immediately. 714 </para> 715 </listitem> 716 </itemizedlist> 717 718 <para> 719 The <varname>action</varname> property controls how a file is 720 moved between primary and seconday storage. It can have the following 721 values: 722 </para> 723 724 <itemizedlist> 725 <listitem> 726 <para> 727 0 = Do nothing 728 </para> 729 </listitem> 730 <listitem> 731 <para> 732 1 = If the file is in secondary storage, move it back to the primary storage 733 </para> 734 </listitem> 735 <listitem> 736 <para> 737 2 = If the file is in primary storage, move it to the secondary storage 738 </para> 739 </listitem> 740 </itemizedlist> 741 742 <para> 743 The actual moving between primary and secondary storage is done by an 744 external program. See 745 <xref linkend="appendix.base.config.secondary" /> and 746 <xref linkend="plugin_developer.other.secondary" /> for more information. 747 </para> 748 749 <para> 750 The <varname>md5</varname> property can be used to check for file 751 corruption when it is moved between primary and secondary storage or 752 when a user re-uploads a file that has been offline. 753 </para> 754 755 <para> 756 BASE can store files in a compressed format. This is handled internally 757 and is not visible to client applications. The <varname>compressed</varname> 758 and <varname>diskSize</varname> properties are used to store information 759 about this. A file may always be compressed if the users says so, but 760 BASE can also do this automatically if the file is uploaded 761 to a directory with the <varname>autoCompress</varname> flag set 762 or if the file has MIME type with the <varname>autoCompress</varname> 763 flag set. 764 </para> 765 766 <para> 767 The <classname>FileTypeData</classname> class holds information about 768 file types. It is used only to make it easier for users to organise 769 their files. 770 </para> 771 772 <para> 773 The <classname>MimeTypeData</classname> is used to register mime types and 774 map them to file extensions. The information is only used to lookup values 775 when needed. Given the filename we can set the <varname>File.mimeType</varname> 776 and <varname>File.fileType</varname> properties. The MIME type is also 777 used to decide if a file should be stored in a compressed format or not. 778 The extension of a MIME type must be unique. Extensions should be registered 779 without a dot, ie <emphasis>html</emphasis>, not <emphasis>.html</emphasis>. 780 </para> 781 782 </sect3> 783 784 651 785 </sect2> 652 786
Note: See TracChangeset
for help on using the changeset viewer.