SlideShare a Scribd company logo
1 of 31
Download to read offline
PHPCR
Standard Interface for Content Repositories
http://bergie.iki.fi
henri.bergius@iki.fi

    @bergie
github.com/bergie/noflo

github.com/bergie/phpflo
Same API, multiple repositories
●
    Jackalope                        ●
                                         Midgard
    ●
        Apache Jackrabbit:               ●
                                             GObject-oriented
        Java-based repository                repository library
        server, accessible                   accessible through
        through WebDAV                       PHP extension
    ●
        Doctrine: pure-PHP               ●
                                             Python, JavaScript,
        repository library                   Java, ...
●
    github.com/jackalope/jackalope   ●
                                         github.com/bergie/phpcr-midgard2
Why use Midgard?
Developers write against a single API

Implementations can be chosen based on
          deployment needs
“Products in MySQL, blog entries in CouchDB”
Standard: JSR-283
Day Management AG, Switzerland                        10-August-2009

Release note

Product:         Specification for
                 Content Repository for Java(tm) Technology API 2.0
Version:         2.0
Type:            Full Release
----------------------------------------------------------------------

This package consists of the following components:

1)   Specification documents:    spec/
2)   Applicable Licenses:        license/
3)   API Source code:            src/
4)   pre-built API .jar-file:    lib/
5)   generated javadoc:          docs/

For questions or comments feel free to use jsr-283-comments@jcp.org

Further information about JSR 283 can be found at
http://www.jcp.org/en/jsr/detail?id=283
Content Management
            Interoperability Services
●   JCR-like API using HTTP and
    Atom (or SOAP)
●   Quite complicated, but
    language-agnostic
●   OASIS spec since 2010
●   Good implementations in
    enterprise document
    management systems
●   Proponents include Microsoft,
    Nuxeo and Alfresco
The next version of JCR will also include
  PHP scripting bindings, i.e. PHPCR
PHPCR is a collection of interfaces
...and API tests
bergie@AirDrone:~/Projects/phpcr-midgard2/api-test$ phpunit
PHPUnit 3.5.5 by Sebastian Bergmann.

I.IIISSSSSSSSS..S.............E..ESSSSSSSSSSSSSSSSSSSSSSSSEE    60   /   552
.........FFSSSSSSSSSSSSS.....E...........................I..   120   /   552
EEI...EEEE......F..........F..........F..........F..........   180   /   552
F..........F..........F......................F..........F...   240   /   552
.......F..........F..........F........ES.............S......   300   /   552
....F.EE..I...E..II......F..............................I...   360   /   552
..........E.I..I.........I............................E.E...   420   /   552
...EE.............................E.........................   480   /   552
........I....................E.EFEF...I.I.IEI..FEE.FF.FFF..F   540   /   552
S.....SSSSSS

Time: 03:53, Memory: 148.50Mb

There were 27 errors:

1) PHPCRTestsQueryQueryManagerTest::testGetQuery
PHPCRQueryInvalidQueryException: Unsupported 'xpath' language

/home/bergie/Projects/phpcr-midgard2/src/Midgard2CR/Query/QueryManager.php:24
/home/bergie/Projects/phpcr-midgard2/src/Midgard2CR/Query/QueryManager.php:62
/home/bergie/Projects/phpcr-midgard2/api-
test/suite/tests/06_Query/QueryManagerTest.php:37
...

FAILURES!
Tests: 536, Assertions: 2331, Failures: 25, Errors: 27, Incomplete: 18, Skipped: 56.
Repository capabilities
●
    Tree access              ●
                                 XML import and
●
    Access by UUID               export
●
    Workspaces
                             ●
                                 Permissions
●
    Versioning
                             ●
                                 Capability discovery
●
    Multi-value properties
                             ●
                                 Observation
●
    Queries: SQL2, QOM
                             ●
                                 Locking &
                                 Transactions
“Simple stuff should be easy, but complex stuff 
           should still be possible”
In PHPCR, all content is stored in a tree of nodes

    Nodes have a name, a type, and a set of
                  properties

        Nodes can also have child nodes
Including PHPCR in your application
●
    PHP 5.3 namespaced code
●
    Use PSR-0 standard autoloader
Connecting to a repository: Midgard
Connecting to a repository: Jackrabbit
●
    Start Jackrabbit:
    $ java -jar jackrabbit-standalone-2.2.5.jar
●
    Connect to repository:
This is the only repository-specific part
Working with the tree
About Node types
●   Node types determine what properties and what kind of
    child nodes a node can have
●   Some built-in types: nt:file, nt:folder, nt:resource,
    nt:unstructured
●   Node types can be amended with “mixin” types, like
    mix:lastModified, mix:language
●   Most repositories allow you to define your own types
●   Recommendation:
    Start with nt:unstructured, add more strict definitions
    when you know your data model
Queries: SQL2
Queries: Query Object Model
Versioning: enable
Versioning: commit
Versioning: restore
Export and import
Export and import
Some projects looking at PHPCR
Some projects looking at PHPCR
Questions?

henri.bergius@iki.fi
       @bergie

More Related Content

What's hot

Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?
Dobrica Pavlinušić
 
How to build a Portofino application
How to build a Portofino applicationHow to build a Portofino application
How to build a Portofino application
Giampiero Granatella
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
sagaroceanic11
 

What's hot (20)

Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full Stack
 
Create JS - A new kind of web editing interface
Create JS  - A new kind of web editing interfaceCreate JS  - A new kind of web editing interface
Create JS - A new kind of web editing interface
 
Віталій Бобров — Web components, Polymer and Drupal
Віталій Бобров — Web components, Polymer and DrupalВіталій Бобров — Web components, Polymer and Drupal
Віталій Бобров — Web components, Polymer and Drupal
 
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and GruntOpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
OpenCms Days 2014 - Enhancing OpenCms front end development with Sass and Grunt
 
MongoDB SF Python
MongoDB SF PythonMongoDB SF Python
MongoDB SF Python
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
 
Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?Post-relational databases: What's wrong with web development?
Post-relational databases: What's wrong with web development?
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browser
 
Decoupling Content Management with Create.js
Decoupling Content Management with Create.jsDecoupling Content Management with Create.js
Decoupling Content Management with Create.js
 
01 intro #burningkeyboards
01 intro #burningkeyboards01 intro #burningkeyboards
01 intro #burningkeyboards
 
OpenCms Days 2016: Multilingual websites with OpenCms
OpenCms Days 2016:   Multilingual websites with OpenCmsOpenCms Days 2016:   Multilingual websites with OpenCms
OpenCms Days 2016: Multilingual websites with OpenCms
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)
 
How to build a Portofino application
How to build a Portofino applicationHow to build a Portofino application
How to build a Portofino application
 
Ruby on rails for beginers
Ruby on rails for beginersRuby on rails for beginers
Ruby on rails for beginers
 
Symfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenutiSymfony CMF: un nuovo paradigma per la gestione dei contenuti
Symfony CMF: un nuovo paradigma per la gestione dei contenuti
 
Why Drupal?
Why Drupal?Why Drupal?
Why Drupal?
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
 
Drupal training-1-in-mumbai
Drupal training-1-in-mumbaiDrupal training-1-in-mumbai
Drupal training-1-in-mumbai
 
Going mobile with RichFaces
Going mobile with RichFacesGoing mobile with RichFaces
Going mobile with RichFaces
 
Avik_RailsTutorial
Avik_RailsTutorialAvik_RailsTutorial
Avik_RailsTutorial
 

Similar to PHPCR - Standard Content Repository for PHP

Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
Marcos Quesada
 

Similar to PHPCR - Standard Content Repository for PHP (20)

PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
betterCode Workshop: Effizientes DevOps-Tooling mit Go
betterCode Workshop:  Effizientes DevOps-Tooling mit GobetterCode Workshop:  Effizientes DevOps-Tooling mit Go
betterCode Workshop: Effizientes DevOps-Tooling mit Go
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
 
Go at Skroutz
Go at SkroutzGo at Skroutz
Go at Skroutz
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!REST in Peace. Long live gRPC!
REST in Peace. Long live gRPC!
 
JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개JBoss EAP 7 & JDG 7 최신 기술 소개
JBoss EAP 7 & JDG 7 최신 기술 소개
 
Node.js an Exectutive View
Node.js an Exectutive ViewNode.js an Exectutive View
Node.js an Exectutive View
 
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
[APIdays Paris 2019] From Microservices to APIs: The API operator in Kubernetes
 
Kubernetes - training micro-dragons without getting burnt
Kubernetes -  training micro-dragons without getting burntKubernetes -  training micro-dragons without getting burnt
Kubernetes - training micro-dragons without getting burnt
 
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Introducing Koki Short
Introducing Koki ShortIntroducing Koki Short
Introducing Koki Short
 
Tech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore RoadmapTech Days 2015: AdaCore Roadmap
Tech Days 2015: AdaCore Roadmap
 
Operator SDK for K8s using Go
Operator SDK for K8s using GoOperator SDK for K8s using Go
Operator SDK for K8s using Go
 
Extending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your wayExtending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your way
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 

More from Henri Bergius

Bisnesdata - Tietojärjestelmien kätköistä tableteille
Bisnesdata - Tietojärjestelmien kätköistä tableteilleBisnesdata - Tietojärjestelmien kätköistä tableteille
Bisnesdata - Tietojärjestelmien kätköistä tableteille
Henri Bergius
 
Proggis - Business Analytics with Linked Data
Proggis - Business Analytics with Linked DataProggis - Business Analytics with Linked Data
Proggis - Business Analytics with Linked Data
Henri Bergius
 
CreateJS hackathon in Zurich
CreateJS hackathon in ZurichCreateJS hackathon in Zurich
CreateJS hackathon in Zurich
Henri Bergius
 
NoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.jsNoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.js
Henri Bergius
 
Location awareness in MeeGo
Location awareness in MeeGoLocation awareness in MeeGo
Location awareness in MeeGo
Henri Bergius
 
Midgard2 Content Repository at FSCONS 2009
Midgard2 Content Repository at FSCONS 2009Midgard2 Content Repository at FSCONS 2009
Midgard2 Content Repository at FSCONS 2009
Henri Bergius
 
Midgard & Nemein - when an open source project and company evolve together
Midgard & Nemein - when an open source project and company evolve togetherMidgard & Nemein - when an open source project and company evolve together
Midgard & Nemein - when an open source project and company evolve together
Henri Bergius
 
Location-aware desktop
Location-aware desktopLocation-aware desktop
Location-aware desktop
Henri Bergius
 
Midgard2: Content repository for desktop and the web
Midgard2: Content repository for desktop and the webMidgard2: Content repository for desktop and the web
Midgard2: Content repository for desktop and the web
Henri Bergius
 
Midgard and the Interactive Knowledge System
Midgard and the Interactive Knowledge SystemMidgard and the Interactive Knowledge System
Midgard and the Interactive Knowledge System
Henri Bergius
 

More from Henri Bergius (20)

Bisnesdata - Tietojärjestelmien kätköistä tableteille
Bisnesdata - Tietojärjestelmien kätköistä tableteilleBisnesdata - Tietojärjestelmien kätköistä tableteille
Bisnesdata - Tietojärjestelmien kätköistä tableteille
 
Create - Decoupled CMS interface
Create - Decoupled CMS interfaceCreate - Decoupled CMS interface
Create - Decoupled CMS interface
 
Proggis - Business Analytics with Linked Data
Proggis - Business Analytics with Linked DataProggis - Business Analytics with Linked Data
Proggis - Business Analytics with Linked Data
 
CreateJS hackathon in Zurich
CreateJS hackathon in ZurichCreateJS hackathon in Zurich
CreateJS hackathon in Zurich
 
NoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.jsNoFlo - Flow-Based Programming for Node.js
NoFlo - Flow-Based Programming for Node.js
 
Symfony2 for Midgard Developers
Symfony2 for Midgard DevelopersSymfony2 for Midgard Developers
Symfony2 for Midgard Developers
 
Midgard Create and VIE
Midgard Create and VIEMidgard Create and VIE
Midgard Create and VIE
 
Location awareness in MeeGo
Location awareness in MeeGoLocation awareness in MeeGo
Location awareness in MeeGo
 
Semantic editor
Semantic editorSemantic editor
Semantic editor
 
Midgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsMidgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applications
 
Midgard2 Content Repository at FSCONS 2009
Midgard2 Content Repository at FSCONS 2009Midgard2 Content Repository at FSCONS 2009
Midgard2 Content Repository at FSCONS 2009
 
Location-aware applications with GeoClue
Location-aware applications with GeoClueLocation-aware applications with GeoClue
Location-aware applications with GeoClue
 
Midgard & Nemein - when an open source project and company evolve together
Midgard & Nemein - when an open source project and company evolve togetherMidgard & Nemein - when an open source project and company evolve together
Midgard & Nemein - when an open source project and company evolve together
 
OSM2Go
OSM2GoOSM2Go
OSM2Go
 
Location-aware desktop
Location-aware desktopLocation-aware desktop
Location-aware desktop
 
Midgard2: Content repository for desktop and the web
Midgard2: Content repository for desktop and the webMidgard2: Content repository for desktop and the web
Midgard2: Content repository for desktop and the web
 
Midgard and the Interactive Knowledge System
Midgard and the Interactive Knowledge SystemMidgard and the Interactive Knowledge System
Midgard and the Interactive Knowledge System
 
Midgard 2 - The cloud you can control
Midgard 2 - The cloud you can controlMidgard 2 - The cloud you can control
Midgard 2 - The cloud you can control
 
Attention Profiling for smarter web services
Attention Profiling for smarter web servicesAttention Profiling for smarter web services
Attention Profiling for smarter web services
 
GeoClue - geo-information framework
GeoClue - geo-information frameworkGeoClue - geo-information framework
GeoClue - geo-information framework
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

PHPCR - Standard Content Repository for PHP

  • 1. PHPCR Standard Interface for Content Repositories
  • 4. Same API, multiple repositories ● Jackalope ● Midgard ● Apache Jackrabbit: ● GObject-oriented Java-based repository repository library server, accessible accessible through through WebDAV PHP extension ● Doctrine: pure-PHP ● Python, JavaScript, repository library Java, ... ● github.com/jackalope/jackalope ● github.com/bergie/phpcr-midgard2
  • 6. Developers write against a single API Implementations can be chosen based on deployment needs
  • 8. Standard: JSR-283 Day Management AG, Switzerland 10-August-2009 Release note Product: Specification for Content Repository for Java(tm) Technology API 2.0 Version: 2.0 Type: Full Release ---------------------------------------------------------------------- This package consists of the following components: 1) Specification documents: spec/ 2) Applicable Licenses: license/ 3) API Source code: src/ 4) pre-built API .jar-file: lib/ 5) generated javadoc: docs/ For questions or comments feel free to use jsr-283-comments@jcp.org Further information about JSR 283 can be found at http://www.jcp.org/en/jsr/detail?id=283
  • 9. Content Management Interoperability Services ● JCR-like API using HTTP and Atom (or SOAP) ● Quite complicated, but language-agnostic ● OASIS spec since 2010 ● Good implementations in enterprise document management systems ● Proponents include Microsoft, Nuxeo and Alfresco
  • 10. The next version of JCR will also include PHP scripting bindings, i.e. PHPCR
  • 11. PHPCR is a collection of interfaces
  • 12. ...and API tests bergie@AirDrone:~/Projects/phpcr-midgard2/api-test$ phpunit PHPUnit 3.5.5 by Sebastian Bergmann. I.IIISSSSSSSSS..S.............E..ESSSSSSSSSSSSSSSSSSSSSSSSEE 60 / 552 .........FFSSSSSSSSSSSSS.....E...........................I.. 120 / 552 EEI...EEEE......F..........F..........F..........F.......... 180 / 552 F..........F..........F......................F..........F... 240 / 552 .......F..........F..........F........ES.............S...... 300 / 552 ....F.EE..I...E..II......F..............................I... 360 / 552 ..........E.I..I.........I............................E.E... 420 / 552 ...EE.............................E......................... 480 / 552 ........I....................E.EFEF...I.I.IEI..FEE.FF.FFF..F 540 / 552 S.....SSSSSS Time: 03:53, Memory: 148.50Mb There were 27 errors: 1) PHPCRTestsQueryQueryManagerTest::testGetQuery PHPCRQueryInvalidQueryException: Unsupported 'xpath' language /home/bergie/Projects/phpcr-midgard2/src/Midgard2CR/Query/QueryManager.php:24 /home/bergie/Projects/phpcr-midgard2/src/Midgard2CR/Query/QueryManager.php:62 /home/bergie/Projects/phpcr-midgard2/api- test/suite/tests/06_Query/QueryManagerTest.php:37 ... FAILURES! Tests: 536, Assertions: 2331, Failures: 25, Errors: 27, Incomplete: 18, Skipped: 56.
  • 13. Repository capabilities ● Tree access ● XML import and ● Access by UUID export ● Workspaces ● Permissions ● Versioning ● Capability discovery ● Multi-value properties ● Observation ● Queries: SQL2, QOM ● Locking & Transactions
  • 15. In PHPCR, all content is stored in a tree of nodes Nodes have a name, a type, and a set of properties Nodes can also have child nodes
  • 16. Including PHPCR in your application ● PHP 5.3 namespaced code ● Use PSR-0 standard autoloader
  • 17. Connecting to a repository: Midgard
  • 18. Connecting to a repository: Jackrabbit ● Start Jackrabbit: $ java -jar jackrabbit-standalone-2.2.5.jar ● Connect to repository:
  • 19. This is the only repository-specific part
  • 21. About Node types ● Node types determine what properties and what kind of child nodes a node can have ● Some built-in types: nt:file, nt:folder, nt:resource, nt:unstructured ● Node types can be amended with “mixin” types, like mix:lastModified, mix:language ● Most repositories allow you to define your own types ● Recommendation: Start with nt:unstructured, add more strict definitions when you know your data model