SlideShare uma empresa Scribd logo
1 de 19
Build your datatypes
About me

•   Edi Modrić
•   Computer engineering masters degree
•   Working at Netgen for 5 years
    •   1 year of .Net development
    •   4 years of eZ Publish development
    •   Certified eZ Publish developer
    •   eZ Tags maintainer
    •   Collaborating with eZ Systems on ezp-next for 8 months


•   @emodric
•   edi@netgen.hr
Agenda

•   Primary agendas
    •   Build a field type using public API
    •   Test the hell out of it

•   Secondary agendas (if time permits)
    •   Comparison to legacy datatypes
    •   Integration with eZ Publish 5 using Symfony
Workshop

•   One hour of coding
    •   Try to build the field type and test it
•   Ideas
    •   Try to port your existing datatype OR
    •   Try to modify the one presented today OR
    •   Some examples
        •   Storing dates < 1.1.1970
        •   Storing and validating IP address
        •   Storing and validating social security number
        •   …
•   Work in groups, help each other
What is a datatype?

•   Base building block of all content in eZ Publish
    •   Collection of methods to store, read and validate content


•   Object oriented architecture of content model

•   Class – blueprint of a single piece of content
    •   Collection of class attributes, which are of some (data)type


•   Object – a single piece of content
    •   Instance of a class
    •   Collection of object attributes, values of class attribute
What is a datatype?
Datatype + public API = field type

•   Initial idea was to demo the eZ Tags datatype
    •   Complicated
    •   We’re time limited


•   eZ Publish 5 is nearly here
    •   Demo the future, not the past
Datatype + public API = field type

•   Content class = Content type
•   Content object = Content
•   Content class attribute = Field definition
•   Content object attribute = Field
•   Object attribute content = Field value
•   Datatype = Field type
Datatype + public API = field type

•   $ cd /var/www/ezp-next/
•   $ rm –rf settings/
•   $ git remote add emodric
    https://github.com/emodric/ezp-
    next.git
•   $ git checkout -b nginteger
•   $ git pull emodric nginteger
•   $ php composer.phar update --dev
•   $ ./Netgen/runtests.sh
Datatype + public API = field type
Datatype + public API = field type

•   eZPublishSPIFieldTypeFieldType
    •   getFieldTypeIdentifier
    •   acceptValue / getEmptyValue
    •   fromHash / toHash
    •   fromPersistenceValue / toPersistenceValue
    •   getSettingsSchema / getValidatorConfigurationSchema
    •   validateFieldSettings / validateValidatorConfiguration
    •   validate
    •   getName
    •   isSearchable
Datatype + public API = field type

•   eZPublishSPIFieldTypeFieldStorage
    •   storeFieldData
    •   getFieldData
    •   deleteFieldData
    •   hasFieldData
    •   getIndexData


•   eZPublishSPIFieldTypeIndexable

•   eZPublishSPIFieldTypeValidationError
Datatype + public API = field type

•   eZPublishCoreFieldTypeFieldType
    •   Abstract that implements …SPIFieldTypeFieldType
    •   Default behavior of some methods + validator handling


•   eZPublishCoreFieldType[GatewayBasedStorage|Null
    Storage]
    •   Abstracts that implement …SPIFieldTypeFieldStorage


•   eZPublishCoreFieldTypeStorageGateway
    •   Abstract for gateways to external storage
    •   used by GatewayBasedStorage
Datatype + public API = field type

•   eZPublishCoreFieldTypeValue
    •   Abstract for field value
    •   Optional, but should be included


•   eZPublishCoreFieldTypeValidationError
    •   Implementation of …SPIFieldTypeValidationError


•   eZPublishCoreFieldTypeValidator
    •   Abstract for all validators to extend


•   eZPublishCoreFieldTypeFileService
“I thought I fixed that” - why testing matters

•   Testing is an integral part of any software development
     •   Keeps your code rock solid
     •   Feature and future proof
     •   Gives you a piece of mind


•   Testing framework in ezp-next is preconfigured BUT
     •   One „hack” is needed if you’re using external storage
         •   Updating database schema fixtures
         •   eZPublishCorePersistenceLegacyTests_fixtures
             schema.sqlite.sql
     •   Dependency injection configuration
“I thought I fixed that” - why testing matters

•   Testing field type integration with public API
     •   Using real world implementation of repository
     •   Tests if our field type plays well with others


•   Testing field type integration with persistence SPI
     •   Hooks directly into persistence implementation
     •   Tests if our field type stores and loads data correctly


•   Unit testing of the field type
     •   Tests the field type methods (units), one by one
What about legacy stack?

•   Legacy datatypes are not going anywhere
    •   No admin interface based on Symfony stack
    •   To actually use your field type, you WILL need legacy datatype


•   https://github.com/emodric/nginteger.git
    •   Legacy datatype prepared for comparison
Field type vs. datatype

•   No difference in functionality

•   Advantages over datatypes is obvious
    •   Much much much easier testing
    •   Clear separation of concerns
        •   No POST variables
        •   No SQL
        •   No file uploads
    •   More readable and understandable code
    •   Object oriented code
Q&A


42

Edi Modrić
  emodric
edi@netgen.hr

Mais conteúdo relacionado

Mais procurados

Design for scale
Design for scaleDesign for scale
Design for scaleDoug Lampe
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewCraig Dickson
 
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA....NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...Christian Nagel
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful ApproachMushfekur Rahman
 
AWS CDK: Infrastructure in TypeScript
AWS CDK: Infrastructure in TypeScriptAWS CDK: Infrastructure in TypeScript
AWS CDK: Infrastructure in TypeScriptAdam Woods
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)Igor Talevski
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesBrett Meyer
 
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInEing Ong
 
Domain Specific Development using T4
Domain Specific Development using T4Domain Specific Development using T4
Domain Specific Development using T4Joubin Najmaie
 
Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Uladzimir Franskevich
 
.NET Core 3.0 - What's new?
.NET Core 3.0 - What's new?.NET Core 3.0 - What's new?
.NET Core 3.0 - What's new?Christian Nagel
 
Parse - Backend as a Service
Parse - Backend as a ServiceParse - Backend as a Service
Parse - Backend as a ServiceAli Davut
 
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Hagander
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus HaganderPG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Hagander
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Haganderpgdayrussia
 
Selenium Online Training
Selenium Online Training Selenium Online Training
Selenium Online Training Nagendra Kumar
 
Core Data in Modern Times
Core Data in Modern TimesCore Data in Modern Times
Core Data in Modern TimesJorge Ortiz
 

Mais procurados (20)

Design for scale
Design for scaleDesign for scale
Design for scale
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief Overview
 
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA....NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
 
Webservices: The RESTful Approach
Webservices: The RESTful ApproachWebservices: The RESTful Approach
Webservices: The RESTful Approach
 
AWS CDK: Infrastructure in TypeScript
AWS CDK: Infrastructure in TypeScriptAWS CDK: Infrastructure in TypeScript
AWS CDK: Infrastructure in TypeScript
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
 
Hands on Gradle
Hands on GradleHands on Gradle
Hands on Gradle
 
Domain Specific Development using T4
Domain Specific Development using T4Domain Specific Development using T4
Domain Specific Development using T4
 
Solr
SolrSolr
Solr
 
Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)Webium: Page Objects In Python (Eng)
Webium: Page Objects In Python (Eng)
 
.NET Core 3.0 - What's new?
.NET Core 3.0 - What's new?.NET Core 3.0 - What's new?
.NET Core 3.0 - What's new?
 
Parse - Backend as a Service
Parse - Backend as a ServiceParse - Backend as a Service
Parse - Backend as a Service
 
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Hagander
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus HaganderPG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Hagander
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Hagander
 
Tricks
TricksTricks
Tricks
 
C# 8 and .NET Core 3
C# 8 and .NET Core 3C# 8 and .NET Core 3
C# 8 and .NET Core 3
 
Selenium Online Training
Selenium Online Training Selenium Online Training
Selenium Online Training
 
Api mation
Api mationApi mation
Api mation
 
Core Data in Modern Times
Core Data in Modern TimesCore Data in Modern Times
Core Data in Modern Times
 

Destaque

Comparing web frameworks
Comparing web frameworksComparing web frameworks
Comparing web frameworksAditya Sengupta
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War StoriesJakub Zalas
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Michael Pirnat
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleRoman Rodomansky
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Roman Rodomansky
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and DjangoMichael Pirnat
 

Destaque (12)

Proposal
ProposalProposal
Proposal
 
Ok shazam, "la la-lalaa"!
Ok shazam, "la la-lalaa"!Ok shazam, "la la-lalaa"!
Ok shazam, "la la-lalaa"!
 
Comparing web frameworks
Comparing web frameworksComparing web frameworks
Comparing web frameworks
 
BDD by example
BDD by exampleBDD by example
BDD by example
 
Neo4j: Graph-like power
Neo4j: Graph-like powerNeo4j: Graph-like power
Neo4j: Graph-like power
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
 

Semelhante a Build your datatypes

eZ Publish Summer Camp 2013 - Building custom field types
eZ Publish Summer Camp 2013 - Building custom field typeseZ Publish Summer Camp 2013 - Building custom field types
eZ Publish Summer Camp 2013 - Building custom field typesEdi Modrić
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino DesignerPaul Withers
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfAnanthReddy38
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfAnanthReddy38
 
DanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIDanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIPaul Withers
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript FundamentalsSunny Sharma
 
Search api d8
Search api d8Search api d8
Search api d8Dropsolid
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料Shinichi Ogawa
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformAntonio Peric-Mazar
 
State of search | drupal dinner
State of search | drupal dinnerState of search | drupal dinner
State of search | drupal dinnerJoris Vercammen
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium SuccessfullyDave Haeffner
 
Zero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExZero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExBradley Brown
 
Pouring Coffee Into the Matrix: Building Java Applications on Neo4j
Pouring Coffee Into the Matrix: Building Java Applications on Neo4jPouring Coffee Into the Matrix: Building Java Applications on Neo4j
Pouring Coffee Into the Matrix: Building Java Applications on Neo4jNeo4j
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Sauce Labs
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfPatiento Del Mar
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, SuccessfullySauce Labs
 
Test driving Azure Search and DocumentDB
Test driving Azure Search and DocumentDBTest driving Azure Search and DocumentDB
Test driving Azure Search and DocumentDBAndrew Siemer
 

Semelhante a Build your datatypes (20)

eZ Publish Summer Camp 2013 - Building custom field types
eZ Publish Summer Camp 2013 - Building custom field typeseZ Publish Summer Camp 2013 - Building custom field types
eZ Publish Summer Camp 2013 - Building custom field types
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Beyond Domino Designer
Beyond Domino DesignerBeyond Domino Designer
Beyond Domino Designer
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdf
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdf
 
DanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIDanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino API
 
Gaej For Beginners
Gaej For BeginnersGaej For Beginners
Gaej For Beginners
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript Fundamentals
 
Search api d8
Search api d8Search api d8
Search api d8
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
State of search | drupal dinner
State of search | drupal dinnerState of search | drupal dinner
State of search | drupal dinner
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
 
Zero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApExZero to Sixty with Oracle ApEx
Zero to Sixty with Oracle ApEx
 
Pouring Coffee Into the Matrix: Building Java Applications on Neo4j
Pouring Coffee Into the Matrix: Building Java Applications on Neo4jPouring Coffee Into the Matrix: Building Java Applications on Neo4j
Pouring Coffee Into the Matrix: Building Java Applications on Neo4j
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
 
Test driving Azure Search and DocumentDB
Test driving Azure Search and DocumentDBTest driving Azure Search and DocumentDB
Test driving Azure Search and DocumentDB
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Build your datatypes

  • 2. About me • Edi Modrić • Computer engineering masters degree • Working at Netgen for 5 years • 1 year of .Net development • 4 years of eZ Publish development • Certified eZ Publish developer • eZ Tags maintainer • Collaborating with eZ Systems on ezp-next for 8 months • @emodric • edi@netgen.hr
  • 3. Agenda • Primary agendas • Build a field type using public API • Test the hell out of it • Secondary agendas (if time permits) • Comparison to legacy datatypes • Integration with eZ Publish 5 using Symfony
  • 4. Workshop • One hour of coding • Try to build the field type and test it • Ideas • Try to port your existing datatype OR • Try to modify the one presented today OR • Some examples • Storing dates < 1.1.1970 • Storing and validating IP address • Storing and validating social security number • … • Work in groups, help each other
  • 5. What is a datatype? • Base building block of all content in eZ Publish • Collection of methods to store, read and validate content • Object oriented architecture of content model • Class – blueprint of a single piece of content • Collection of class attributes, which are of some (data)type • Object – a single piece of content • Instance of a class • Collection of object attributes, values of class attribute
  • 6. What is a datatype?
  • 7. Datatype + public API = field type • Initial idea was to demo the eZ Tags datatype • Complicated • We’re time limited • eZ Publish 5 is nearly here • Demo the future, not the past
  • 8. Datatype + public API = field type • Content class = Content type • Content object = Content • Content class attribute = Field definition • Content object attribute = Field • Object attribute content = Field value • Datatype = Field type
  • 9. Datatype + public API = field type • $ cd /var/www/ezp-next/ • $ rm –rf settings/ • $ git remote add emodric https://github.com/emodric/ezp- next.git • $ git checkout -b nginteger • $ git pull emodric nginteger • $ php composer.phar update --dev • $ ./Netgen/runtests.sh
  • 10. Datatype + public API = field type
  • 11. Datatype + public API = field type • eZPublishSPIFieldTypeFieldType • getFieldTypeIdentifier • acceptValue / getEmptyValue • fromHash / toHash • fromPersistenceValue / toPersistenceValue • getSettingsSchema / getValidatorConfigurationSchema • validateFieldSettings / validateValidatorConfiguration • validate • getName • isSearchable
  • 12. Datatype + public API = field type • eZPublishSPIFieldTypeFieldStorage • storeFieldData • getFieldData • deleteFieldData • hasFieldData • getIndexData • eZPublishSPIFieldTypeIndexable • eZPublishSPIFieldTypeValidationError
  • 13. Datatype + public API = field type • eZPublishCoreFieldTypeFieldType • Abstract that implements …SPIFieldTypeFieldType • Default behavior of some methods + validator handling • eZPublishCoreFieldType[GatewayBasedStorage|Null Storage] • Abstracts that implement …SPIFieldTypeFieldStorage • eZPublishCoreFieldTypeStorageGateway • Abstract for gateways to external storage • used by GatewayBasedStorage
  • 14. Datatype + public API = field type • eZPublishCoreFieldTypeValue • Abstract for field value • Optional, but should be included • eZPublishCoreFieldTypeValidationError • Implementation of …SPIFieldTypeValidationError • eZPublishCoreFieldTypeValidator • Abstract for all validators to extend • eZPublishCoreFieldTypeFileService
  • 15. “I thought I fixed that” - why testing matters • Testing is an integral part of any software development • Keeps your code rock solid • Feature and future proof • Gives you a piece of mind • Testing framework in ezp-next is preconfigured BUT • One „hack” is needed if you’re using external storage • Updating database schema fixtures • eZPublishCorePersistenceLegacyTests_fixtures schema.sqlite.sql • Dependency injection configuration
  • 16. “I thought I fixed that” - why testing matters • Testing field type integration with public API • Using real world implementation of repository • Tests if our field type plays well with others • Testing field type integration with persistence SPI • Hooks directly into persistence implementation • Tests if our field type stores and loads data correctly • Unit testing of the field type • Tests the field type methods (units), one by one
  • 17. What about legacy stack? • Legacy datatypes are not going anywhere • No admin interface based on Symfony stack • To actually use your field type, you WILL need legacy datatype • https://github.com/emodric/nginteger.git • Legacy datatype prepared for comparison
  • 18. Field type vs. datatype • No difference in functionality • Advantages over datatypes is obvious • Much much much easier testing • Clear separation of concerns • No POST variables • No SQL • No file uploads • More readable and understandable code • Object oriented code
  • 19. Q&A 42 Edi Modrić emodric edi@netgen.hr