the file abstraction layer in typo3 6.0
DESCRIPTION
The Slides of th Talk about the FileAbstraction Layer at the T3CON12 in Québec City, Canada.Gives an Overview about Concepts, Changes for Editors as well as a short introduction in usage for Development.TRANSCRIPT
1
T3CON12Québec City
FILE ABSTRACTION LAYER
2
Introduction into File Abstraction current State in TYPO3 goals and concepts
The File Abstraction Layer in TYPO3 6.0 influences on editors architecture FAL vs. DAM
Developers Information: Customize FAL custom Drivers usage in Extensions extending FAL
AGENDA
htt
p:/
/th
epla
yund
erg
rou
nd
.com
/im
ag
es/
Fold
er%
20
Sta
ck.jpg
3
Germany, near Frankfurt
Studied Computer Science
Freelancer for TYPO3 Development
TYPO3 since 2006 Core Team Member Release Manager 4.7
STEFFEN RITTER
4
Current State,Goals,History,Concepts
INTRODUCTION
5
plain PHP functions (fopen, is_dir, …)operating system restriction: Windows vs. Unixfi les in TYPO3 site root
Usage copied to uploads/thumbnails copied to typo3temp/
obtains disk space replacing fi les diffi cult meta-data distributed
INTRODUCTION: CURRENT STATE
6
omit superfluous copies reference fi les
central meta-data management
no direct fi le-system access
external fi le-systems
„DAM“ with core support
INTRODUCTION: GOALS
7
planned since years
several attempts / refactorings
huge task DAM not core
finally: BLE-project with planned integration in 4.7
released with 6.0alpha1 improvements and actions welcome
INTRODUCTION: HISTORY AND FUTURE
8
Resource – element in fi le-system
File – real fi le in fi le-system
Folder– structuring unit of fi le-system Folder in local file-system, tag or album in Flickr
ProcessedFile – variants References File
INTRODUCTION: CONCEPTS
9
Storage – unix: mount Mount-point definition Aggregation: Driver, Name, Path, „user-mount “
Driver– low-level interface php file-system calls WebDAV: PUT/GET/POST …
INTRODUCTION: CONCEPTS
10
Changes for Editors
FILE ABSTRACTIONIN TYPO3 6.0
11
CHANGES FOR EDITORS: FILE MODULE
12
CHANGES FOR EDITOR: IMAGES
13
CHANGES FOR EDITOR: HCI CHANGES
14
CHANGES FOR EDITORS: UPLOADS
15
CHANGES FOR EDITORS: FILE-META DATA
16
WITH MEDIA INSTALLED:
„bridge to DAM“
CHANGES FOR EDITORS: FILE-META DATA
17
ArchitectureFILE ABSTRACTION
IN TYPO3 6.0
18
Interface to code against
Objects in memory
In fi le-system
ARCHITECTURE: CLASS HIERARCHY
19
File: database (sys_fi le)Folder: transientStorage: database (sys_storage)FileReference: database (sys_fi le_reference)ProcessedFile: database (sys_fi le_processedfi le)
References in Database: [UID]Folder: [???]
ARCHITECTURE: PERSISTENCE
20
4 diff erent Identifi er: Identifier Combined Identifier uid Sha1 (internal only)
Identifi er user_up load /Admin / tes t .h tml
String, unique within Storage useless without storage
Combined Identifi er 1:user_up load /Admin / tes t .h tml
Extends identifier with Storage UID [StorageUid]:[Identifier]
uid Indexed elements Database relations
ARCHITECTURE: IDENTIFY A RESOURCE
21
WAAAHH?
ARCHITECTURE: IDENTIFY A RESOURCE
22
Which Identifier to use?
Combined-Identifier: TypoScript, Hand over file to FAL manual references
Uid internally (extensions, php, database) Whenever possible (better performance)
ARCHITECTURE: IDENTIFY A RESOURCE
23
Gimmick / Backwards compatibilty: Legacy Files
„Virtual Storage“ uid: 0 local-driver Root at TYPO3_site not indexed!
Access all files: 0:uploads/pics/bla.jpg 0:typo3conf/ext/myEXT/ext_icon.gif
ARCHITECTURE: IDENTIFY A RESOURCE
24
Top-Level in fi le-tree
Drivers can ship custom config WebDAV: Username, Password, …
Offl ine/Online detection for Remote data sources
ARCHITECTURE: STORAGE AND MOUNTPOINTS
25
„FileMounts“: new definition Label
Storage
All Folders in Storage selectable
User-FileMounts „fi lter“ Storage All storages in filetree Only accessible folder shown
ARCHITECTURE: STORAGE AND MOUNTPOINTS
26
New collection Interfaces since TYPO3 4.7Central storage/grouping of records/dataSimilar JCF / STL Container
FAL extends Collection: Folder-Collection: All files within a folder Static-Collection: pre selected files
Extensions/Upload-CE uses „collection“ Central exchange of files
ARCHITECTURE: COLLECTIONS
27
FAL VS. DAM
28
FAL is NOT compatible to DAM FAL won‘t replace DAM
FAL concentrates on fi le meta-data DAM concentrates on fi le-content meta-data
DAM 2.0 Media Extension Static collections - FAL Folder collections - FAL Tag/Filter collection - t.b.d
Migration possible (to a certain extend)
New projects with DAM??? Start with 6.0alpha1 and FAL!!!
FILE ABSTRACTION LAYER AND D.A.M.
29
Use, Extend and customize the File Abstraction Layer
DEVELOPERS INFORMATION
30
Possibilities: WebDAV, Flickr, Amazon S3, FTP, SharePoint…
Driver Interface + Registry1. implement Interface2. Register at Registry3. configure within Storage
DEVELOPERS INFORMATION: CUSTOM DRIVERS
31
New TypoScript Object „FILES“
DEVELOPERS INFORMATION: TYPOSCRIPT
32
collections selected in TCE-FormPHP Code has to work with them
DEVELOPERS INFORMATION:WORKING WITH COLLECTIONS
33
Currently: Check for „is fi le“
New prefix „fi le:“ file:1:user_upload/index.html file:735
DEVELOPERS INFORMATION:RETRIEVING FILES FROM TYPOLINK