SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
s
s
What is a Field Type
• Base building block of all content in eZ Publish
• Collection of methods to store, read and validate content
• Object oriented architecture of content model
• Content type – blueprint of a single piece of content
• Collection of class attributes, which are of some (data)type
• Content – a single piece of content
• Instance of a class
• Collection of Fields, values of FieldDefinitions
What is a datatype (aka FieldType)
Updated Glossary
eZ Publish 4 eZ Publish 5
Content object Content
Content class Content Type
Content object attribute Field
Content class attribute Field Definition
Object attribute content Field Value
Datatype Field Type
How it is consumed
FieldType API
eZPublishSPIFieldTypeFieldType
• getFieldTypeIdentifier
• acceptValue / getEmptyValue
• fromHash / toHash
• fromPersistenceValue / toPersistenceValue
• getSettingsSchema /
getValidatorConfigurationSchema
• validateFieldSettings / validateValidatorConfiguration
• validate
• getName
• isSearchable
FieldType SPI (interfaces to implement)
•eZPublishSPIFieldTypeFieldStorage
• storeFieldData
• getFieldData
• deleteFieldData
• hasFieldData
• getIndexData
•eZPublishSPIFieldTypeIndexable
•eZPublishSPIFieldTypeValidationError
FieldType API abstract classes
eZPublishCoreFieldTypeFieldType
• Abstract that implements …SPIFieldTypeFieldType
• Default behavior of some methods + validator handling
Needed for Legacy Storage Engine:
eZPublishCoreFieldTypeGatewayBasedStorage
• Abstract that implements …SPIFieldTypeFieldStorage
eZPublishCoreFieldTypeStorageGateway
• Abstract for gateways to external storage
• Used by GatewayBasedStorage
eZPublishCorePersistenceLegacyContentFieldValueCon
verter
FieldType API abstract classes #2
•eZPublishCoreFieldTypeValue
• Abstract for field value
•eZPublishCoreFieldTypeValidationError
• Implementation of
…SPIFieldTypeValidationError
•eZPublishCoreFieldTypeValidator
• Abstract for all validators to extend
•eZPublishCoreIOIOService
• Binary files IO handling
FieldType standardized unit/integration tests
•API integration tests
• Using real world implementation of repository
• Tests if our field type plays well with others
• eZPublishAPIRepositoryTestsFieldTypeTextLineIntegrationTest.php
•SPI integration tests
• Hooks directly into persistence implementation
• Tests if our field type stores and loads data correctly
• eZPublishSPITestsFieldTypeTextLineIntegrationTest.php
•Unit testing of the field type
• Tests the field type methods (units), one by one
• eZPublishCoreFieldTypeTestsTextLineTest.php
•TDD is your friend. Really!
What about BC
•Right now: Think dual kernel
• Datatype [legacy] for the backoffice
• FieldType [5.x] for the front
•Yes, you currently have to write both
The end
?
Twitter: @bdunogier & @andrerom
Google+: http://gplus.to/BertrandDunogier
SlideShare: http://slideshare.net/BertrandDunogier

Más contenido relacionado

Más de eZ Publish Community

2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...eZ Publish Community
 
How is the 5.x data model going to compare to 4.x (+no sql )
How is the 5.x data model going to compare  to 4.x (+no sql )How is the 5.x data model going to compare  to 4.x (+no sql )
How is the 5.x data model going to compare to 4.x (+no sql )eZ Publish Community
 
Handling transition between 4.x and 5.x.
Handling transition between 4.x and 5.x.Handling transition between 4.x and 5.x.
Handling transition between 4.x and 5.x.eZ Publish Community
 
E z publish 5 template syntax (twig),
E z publish 5 template syntax (twig),E z publish 5 template syntax (twig),
E z publish 5 template syntax (twig),eZ Publish Community
 
2012 10-17 un conference ez publish cloud presentation
2012 10-17 un conference ez publish cloud presentation2012 10-17 un conference ez publish cloud presentation
2012 10-17 un conference ez publish cloud presentationeZ Publish Community
 
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011eZ Publish Community
 
Tony Wood - Keynote Vision with Technology
Tony Wood - Keynote Vision with TechnologyTony Wood - Keynote Vision with Technology
Tony Wood - Keynote Vision with TechnologyeZ Publish Community
 
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in Asia
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in AsiaSimon Wan - Keynote - The Web Strategy of the Wall Street Journal in Asia
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in AsiaeZ Publish Community
 
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case Study
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case StudyMark Marsiglio - Autoscaling with eZ in the Cloud - A Case Study
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case StudyeZ Publish Community
 
Marianne Otterdahl Møller - Multinational and multichannel market communication
Marianne Otterdahl Møller - Multinational and multichannel market communicationMarianne Otterdahl Møller - Multinational and multichannel market communication
Marianne Otterdahl Møller - Multinational and multichannel market communicationeZ Publish Community
 
Gabriele Viebach - Keynote eZ Conference
Gabriele Viebach - Keynote eZ ConferenceGabriele Viebach - Keynote eZ Conference
Gabriele Viebach - Keynote eZ ConferenceeZ Publish Community
 
Björn Dieding - The Globalization Supply Chain - eZ Market Talk
Björn Dieding - The Globalization Supply Chain - eZ Market TalkBjörn Dieding - The Globalization Supply Chain - eZ Market Talk
Björn Dieding - The Globalization Supply Chain - eZ Market TalkeZ Publish Community
 
Peter Dodds - Paid content at Financial Times
Peter Dodds - Paid content at Financial TimesPeter Dodds - Paid content at Financial Times
Peter Dodds - Paid content at Financial TimeseZ Publish Community
 
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...eZ Publish Community
 
Martin Bauer - Scrum, The Financial Times & eZ Publish
Martin Bauer - Scrum, The Financial Times & eZ PublishMartin Bauer - Scrum, The Financial Times & eZ Publish
Martin Bauer - Scrum, The Financial Times & eZ PublisheZ Publish Community
 
Marc Czieslick - flash-talk - Content Cockpit
Marc Czieslick - flash-talk - Content CockpitMarc Czieslick - flash-talk - Content Cockpit
Marc Czieslick - flash-talk - Content CockpiteZ Publish Community
 

Más de eZ Publish Community (20)

2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
 
Cxm mobile stig martin fiska
Cxm mobile   stig martin fiskaCxm mobile   stig martin fiska
Cxm mobile stig martin fiska
 
App factory igor vrdoljak
App factory   igor vrdoljakApp factory   igor vrdoljak
App factory igor vrdoljak
 
How is the 5.x data model going to compare to 4.x (+no sql )
How is the 5.x data model going to compare  to 4.x (+no sql )How is the 5.x data model going to compare  to 4.x (+no sql )
How is the 5.x data model going to compare to 4.x (+no sql )
 
Handling transition between 4.x and 5.x.
Handling transition between 4.x and 5.x.Handling transition between 4.x and 5.x.
Handling transition between 4.x and 5.x.
 
E z publish 5 template syntax (twig),
E z publish 5 template syntax (twig),E z publish 5 template syntax (twig),
E z publish 5 template syntax (twig),
 
2012 10-17 un conference ez publish cloud presentation
2012 10-17 un conference ez publish cloud presentation2012 10-17 un conference ez publish cloud presentation
2012 10-17 un conference ez publish cloud presentation
 
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011
Mugo - Approval Workflow extension for eZ Publish - eZ Day Paris - Oct 14th 2011
 
Tony Wood - Keynote Vision with Technology
Tony Wood - Keynote Vision with TechnologyTony Wood - Keynote Vision with Technology
Tony Wood - Keynote Vision with Technology
 
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in Asia
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in AsiaSimon Wan - Keynote - The Web Strategy of the Wall Street Journal in Asia
Simon Wan - Keynote - The Web Strategy of the Wall Street Journal in Asia
 
Maxime Thomas - eZBK
Maxime Thomas - eZBKMaxime Thomas - eZBK
Maxime Thomas - eZBK
 
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case Study
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case StudyMark Marsiglio - Autoscaling with eZ in the Cloud - A Case Study
Mark Marsiglio - Autoscaling with eZ in the Cloud - A Case Study
 
Marianne Otterdahl Møller - Multinational and multichannel market communication
Marianne Otterdahl Møller - Multinational and multichannel market communicationMarianne Otterdahl Møller - Multinational and multichannel market communication
Marianne Otterdahl Møller - Multinational and multichannel market communication
 
Gabriele Viebach - Keynote eZ Conference
Gabriele Viebach - Keynote eZ ConferenceGabriele Viebach - Keynote eZ Conference
Gabriele Viebach - Keynote eZ Conference
 
Mark Pilipczuk - Neustar Journey
Mark Pilipczuk - Neustar JourneyMark Pilipczuk - Neustar Journey
Mark Pilipczuk - Neustar Journey
 
Björn Dieding - The Globalization Supply Chain - eZ Market Talk
Björn Dieding - The Globalization Supply Chain - eZ Market TalkBjörn Dieding - The Globalization Supply Chain - eZ Market Talk
Björn Dieding - The Globalization Supply Chain - eZ Market Talk
 
Peter Dodds - Paid content at Financial Times
Peter Dodds - Paid content at Financial TimesPeter Dodds - Paid content at Financial Times
Peter Dodds - Paid content at Financial Times
 
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...
Stuart Wilkinson - Media audit and brand consistency - metrics and trends fro...
 
Martin Bauer - Scrum, The Financial Times & eZ Publish
Martin Bauer - Scrum, The Financial Times & eZ PublishMartin Bauer - Scrum, The Financial Times & eZ Publish
Martin Bauer - Scrum, The Financial Times & eZ Publish
 
Marc Czieslick - flash-talk - Content Cockpit
Marc Czieslick - flash-talk - Content CockpitMarc Czieslick - flash-talk - Content Cockpit
Marc Czieslick - flash-talk - Content Cockpit
 

eZ Unconference#2 - Fieldtype - A. Rømcke

  • 1. s s
  • 2. What is a Field Type • Base building block of all content in eZ Publish • Collection of methods to store, read and validate content • Object oriented architecture of content model • Content type – blueprint of a single piece of content • Collection of class attributes, which are of some (data)type • Content – a single piece of content • Instance of a class • Collection of Fields, values of FieldDefinitions
  • 3. What is a datatype (aka FieldType)
  • 4. Updated Glossary eZ Publish 4 eZ Publish 5 Content object Content Content class Content Type Content object attribute Field Content class attribute Field Definition Object attribute content Field Value Datatype Field Type
  • 5. How it is consumed
  • 6. FieldType API eZPublishSPIFieldTypeFieldType • getFieldTypeIdentifier • acceptValue / getEmptyValue • fromHash / toHash • fromPersistenceValue / toPersistenceValue • getSettingsSchema / getValidatorConfigurationSchema • validateFieldSettings / validateValidatorConfiguration • validate • getName • isSearchable
  • 7. FieldType SPI (interfaces to implement) •eZPublishSPIFieldTypeFieldStorage • storeFieldData • getFieldData • deleteFieldData • hasFieldData • getIndexData •eZPublishSPIFieldTypeIndexable •eZPublishSPIFieldTypeValidationError
  • 8. FieldType API abstract classes eZPublishCoreFieldTypeFieldType • Abstract that implements …SPIFieldTypeFieldType • Default behavior of some methods + validator handling Needed for Legacy Storage Engine: eZPublishCoreFieldTypeGatewayBasedStorage • Abstract that implements …SPIFieldTypeFieldStorage eZPublishCoreFieldTypeStorageGateway • Abstract for gateways to external storage • Used by GatewayBasedStorage eZPublishCorePersistenceLegacyContentFieldValueCon verter
  • 9. FieldType API abstract classes #2 •eZPublishCoreFieldTypeValue • Abstract for field value •eZPublishCoreFieldTypeValidationError • Implementation of …SPIFieldTypeValidationError •eZPublishCoreFieldTypeValidator • Abstract for all validators to extend •eZPublishCoreIOIOService • Binary files IO handling
  • 10. FieldType standardized unit/integration tests •API integration tests • Using real world implementation of repository • Tests if our field type plays well with others • eZPublishAPIRepositoryTestsFieldTypeTextLineIntegrationTest.php •SPI integration tests • Hooks directly into persistence implementation • Tests if our field type stores and loads data correctly • eZPublishSPITestsFieldTypeTextLineIntegrationTest.php •Unit testing of the field type • Tests the field type methods (units), one by one • eZPublishCoreFieldTypeTestsTextLineTest.php •TDD is your friend. Really!
  • 11. What about BC •Right now: Think dual kernel • Datatype [legacy] for the backoffice • FieldType [5.x] for the front •Yes, you currently have to write both
  • 12. The end ? Twitter: @bdunogier & @andrerom Google+: http://gplus.to/BertrandDunogier SlideShare: http://slideshare.net/BertrandDunogier