The File Abstraction Layer in TYPO3 6.0

33
T3CON12 Québec City FILE ABSTRACTION LAYER 1

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 of The File Abstraction Layer in TYPO3 6.0

Page 1: The File Abstraction Layer in TYPO3 6.0

1

T3CON12Québec City

FILE ABSTRACTION LAYER

Page 2: The File Abstraction Layer in TYPO3 6.0

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

Page 3: The File Abstraction Layer in TYPO3 6.0

3

Germany, near Frankfurt

Studied Computer Science

Freelancer for TYPO3 Development

TYPO3 since 2006 Core Team Member Release Manager 4.7

STEFFEN RITTER

Page 4: The File Abstraction Layer in TYPO3 6.0

4

Current State,Goals,History,Concepts

INTRODUCTION

Page 5: The File Abstraction Layer in TYPO3 6.0

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

Page 6: The File Abstraction Layer in TYPO3 6.0

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

Page 7: The File Abstraction Layer in TYPO3 6.0

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

Page 8: The File Abstraction Layer in TYPO3 6.0

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

Page 9: The File Abstraction Layer in TYPO3 6.0

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

Page 10: The File Abstraction Layer in TYPO3 6.0

10

Changes for Editors

FILE ABSTRACTIONIN TYPO3 6.0

Page 11: The File Abstraction Layer in TYPO3 6.0

11

CHANGES FOR EDITORS: FILE MODULE

Page 12: The File Abstraction Layer in TYPO3 6.0

12

CHANGES FOR EDITOR: IMAGES

Page 13: The File Abstraction Layer in TYPO3 6.0

13

CHANGES FOR EDITOR: HCI CHANGES

Page 14: The File Abstraction Layer in TYPO3 6.0

14

CHANGES FOR EDITORS: UPLOADS

Page 15: The File Abstraction Layer in TYPO3 6.0

15

CHANGES FOR EDITORS: FILE-META DATA

Page 16: The File Abstraction Layer in TYPO3 6.0

16

WITH MEDIA INSTALLED:

„bridge to DAM“

CHANGES FOR EDITORS: FILE-META DATA

Page 17: The File Abstraction Layer in TYPO3 6.0

17

ArchitectureFILE ABSTRACTION

IN TYPO3 6.0

Page 18: The File Abstraction Layer in TYPO3 6.0

18

Interface to code against

Objects in memory

In fi le-system

ARCHITECTURE: CLASS HIERARCHY

Page 19: The File Abstraction Layer in TYPO3 6.0

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

Page 20: The File Abstraction Layer in TYPO3 6.0

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

Page 21: The File Abstraction Layer in TYPO3 6.0

21

WAAAHH?

ARCHITECTURE: IDENTIFY A RESOURCE

Page 22: The File Abstraction Layer in TYPO3 6.0

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

Page 23: The File Abstraction Layer in TYPO3 6.0

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

Page 24: The File Abstraction Layer in TYPO3 6.0

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

Page 25: The File Abstraction Layer in TYPO3 6.0

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

Page 26: The File Abstraction Layer in TYPO3 6.0

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

Page 27: The File Abstraction Layer in TYPO3 6.0

27

FAL VS. DAM

Page 28: The File Abstraction Layer in TYPO3 6.0

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.

Page 29: The File Abstraction Layer in TYPO3 6.0

29

Use, Extend and customize the File Abstraction Layer

DEVELOPERS INFORMATION

Page 30: The File Abstraction Layer in TYPO3 6.0

30

Possibilities: WebDAV, Flickr, Amazon S3, FTP, SharePoint…

Driver Interface + Registry1. implement Interface2. Register at Registry3. configure within Storage

DEVELOPERS INFORMATION: CUSTOM DRIVERS

Page 31: The File Abstraction Layer in TYPO3 6.0

31

New TypoScript Object „FILES“

DEVELOPERS INFORMATION: TYPOSCRIPT

Page 32: The File Abstraction Layer in TYPO3 6.0

32

collections selected in TCE-FormPHP Code has to work with them

DEVELOPERS INFORMATION:WORKING WITH COLLECTIONS

Page 33: The File Abstraction Layer in TYPO3 6.0

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