SlideShare a Scribd company logo
1 of 38
Download to read offline
An Overview of
ModeShape
                 September 2010


 modeshape.org
Topics

• Why use JCR?
• Why use ModeShape?
• Productization




                        2
What is JCR?
                                  JSR-170 and JSR-283

                • Standard programmatic API: javax.jcr
                • Abstracts where/how the content is stored
                • Best features from databases and file systems




Image credit: David Nuescheler                                   3
Typical uses of JCR

  • Content management systems
  • Portals (e.g., GateIn)
  • Knowledge bases
  • Test management systems
  • Artifact repositories (e.g., BRMS, EDS, ...)




                                                   4
Why use a JCR repository?
      • Flexible data structure
        -   because your data will change

      • Hierarchical graph-based storage
        -   natural organization
        -   flexible schema
        -   handles wide variety of content

      • Search & query
      • Versioning, events, access control,
        referential integrity, locking
      • Standard API
                                              5
Fundamental elements of JCR
                      Repository


              Workspacen           Namespace
                                    Registry

                                   Node Type
                                    Manager

 Sessionm
 Sessionmm
  Session
  Sessionm                          Version
   Sessionm
   Sessionm                Nodes    Manager

                                     Lock
                                    Manager

                                     other
                                    services




                                               6
Why use JCR?

Hierarchical organization
    • Great for natural hierarchies
      - URLs and file systems
      - Dates
      - Composition
      - Catalogs
      - ... many others
    • Examples
      - Files and folders (artifacts)
      - Database schemas
      - Web services
      - XML, YAML, JSON, etc.
                                        7
Why use JCR?

       Flexible schema (part 1)
Each JCR node has:
• Name, path, & identifier
• Properties
   -   name & value(s)                                      Status Report.pdf

   -
                                              jcr:primaryType      nt:file
       property types                         jcr:mixinTypes       [acme:tagged]


• Child nodes
                                              jcr:createdBy        jsmith
                                              jcr:created          2010-07-31T08:10:14

   -   same-name-siblings                     acme:tags            ["status", "projectX"]


   -   may be ordered

• One or more node types
   -   primary type and mixins
   -   dictate whether properties and children can be added/removed
   -   can be changed at any time on each node

                                                                                            8
Why use JCR?

       Flexible schema (part 2)
JCR node types:
 • define the allowed properties
   -   name (or unrestricted with “*”)   LONG, DOUBLE,
                                         DECIMAL, DATE,
   -   type                              BOOLEAN, NAME,
   -   number of values                  PATH, URI,

   -   searchability                     REFERENCE,
                                         WEAK_REFERENCE,
   -   mandatory                         UNDEFINED

 • define the allowed child nodes
   -   name (or unrestricted with “*”)
   -   required node types
   -   same-name-siblings allowed
 • inheritance and mixed together
                                                           9
Why use JCR?

      Query languages

• XPath             From JCR 1.0,
                    deprecated in JCR 2.0
• JCR-SQL
• JCR-SQL2
                    New in JCR 2.0
• JCR-JQOM




                                            10
Why use JCR?

JCR-SQL2 is based upon SQL
              JCR-SQL2                    SQL
              node type                   table
              property                    column
              node                        row


 Nodes appear as rows in those tables that
 correspond to the node’s types
  - a node can appear as a row in multiple tables
  - often a complete picture of a node requires joining multiple tables
  - other joins are possible, such as ancestors, descendants,
     equivalent properties

                                                                          11
Why use JCR?

        JCR-SQL2 features
•    Select
•    Joins (INNER, LEFT/RIGHT OUTER)
•    Property & name criteria
•    Child & descendant node criteria
•    Comparison operators (=,<,<=,>,>=,<>, LIKE)
• Logical operators (AND, OR, NOT)
• Full-text search criteria
• Variables

    ModeShape accepts all valid JCR-SQL2 queries
                                                   12
Why use JCR?

     Sample JCR-SQL2 queries
SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006




SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
WHERE NAME() LIKE $name




SELECT file.*,content.* FROM [nt:file] AS file
JOIN [nt:resource] AS content ON ISCHILDNODE(content,file)
WHERE NAME(file) LIKE 'q*.2.vdb'




                                                                                   13
Why use JCR?

Other benefits
• Versioning
• Notification (events)
• Access control
• Referential integrity
• Locking
• Standard API



                          14
Using JCR 2.0 repositories
       • Uses JCR 2.0 API & Java SE ServiceLoader
       • No implementation dependencies
Java code:
   Properties parameters = new Properties();
   parameters.load(...);          // load from a file
   Repository repository = null;
   for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) {
       repository = factory.getRepository(parameters);
       if (repository != null) break;
   }


Properties for ModeShape:
   org.modeshape.jcr.URL = file:path/to/configRepository.xml?repositoryName=MyRepository
                                         or
   org.modeshape.jcr.URL = jndi:/jcr/local?repositoryName=MyRepository
                                                                                           15
Why use ModeShape?
   • Supports JCR 2.0
   • Storage options
   • Access existing content thru JCR
   • Unified repository via federation
   • Automatically derives content
   • Lightweight, embeddable & clusterable
   • Plays well with JBoss AS


                                         16
Why use ModeShape?

                              Storage options
                                     JCR Client
                                     Application                            • Store content where it
                                           JCR API                            makes sense for your
                                                                              application
                                ModeShape
                               JCR Repository                               • Multiple connectors
                                                                              out-of-the-box

                                        ?                                   • Easy enough to write
                                                                              your own
                                                                            ?
 Transient Infinispan      JBoss         JDBC          File      SVN         Other
in-memory data grid      Cache        Database       System   repository   systems
  storage  for storage for storage   for storage


                                                                                                     17
Why use ModeShape?

          Storage examples
• Store in RDBMS using Hibernate
  - Conventional and well-understood
• Store in Infinispan
  - Scalability, fault tolerance and speed of a data grid
• Store artifacts on file system
  - Images, documents, downloads, static pages, etc.
  - Serve files via file system, bypassing JCR altogether
  - Manipulate content through JCR (e.g., CMS)
• Transient in-memory
  - Lightweight and fast for embedded uses
  - Often used with imported data
                                                            18
Why use ModeShape?

       Accessing other data
                    JCR Client
                    Application                          • Use JCR API to
                          JCR API                          access data from
                                                           other systems
                ModeShape
                JCR Repository                           • Leave the data
                                                           where it is

                       ?                                 • Just another
                                                           connector

                                                ?
   JCR         JDBC    File         SVN         Other
repositories Database System      repository   systems
              schema


                                                                              19
Why use ModeShape?

       Access examples

• Access files already stored on file system
  - Use the JCR API within your application
  - Use search and query
• Access database metadata (live)
  - Leverage session-based caching
  - Consistent model
• Access (& manipulate) content in other JCRs
  - Got data already in another JCR system?
  - Makes most sense with federation ...

                                                20
Why use ModeShape?

                                     Federation

                                        JCR Client               • Use JCR API to
                                        Application
                                                                   access a virtual,
                                              JCR API              unified repository

                                    ModeShape                    • Leave the data
                                       Federated                   where it is
                                       Repository




                                                                             ?
 Transient      JBoss     Infinispan     JDBC      JDBC     File    SVN       Other
in-memory      Cache       data grid  Database Database   System repository systems
  storage    for storage for storage for storage schema



                                                                                       21
Why use ModeShape?

      Federation examples
• Own some content, access other data
  - Use the JCR API consistently throughout your application
  - Single virtual and unified repository
  - Leverage JCR’s flexible schema
  - Use search and query across all data
  - Leave existing data where it lives
• Use the best data store for each kind of data
  - Use the JCR API consistently throughout your application
  - Single virtual and unified repository
  - Match access and capabilities with requirements

                                                               22
Why use ModeShape?

        Query languages

• XPath                        From JCR 1.0,
                               deprecated in JCR 2.0
• JCR-SQL
• JCR-SQL2
                               New in JCR 2.0
• JCR-JQOM
• Full-text search           Like web search engines, based on
                             JCR-SQL2’s full-text search
                             expression grammar


         Separate parsers, but all use the same
     canonical AST, planner, optimizer, and processor
                                                                 23
Why use ModeShape?

           Enhanced JCR-SQL2
ModeShape accepts all valid JCR-SQL2 queries, plus:
  •   Additional joins (FULL OUTER, CROSS)
  •   Subqueries in criteria
  •   SELECT [DISTINCT]
  •   UNION/INTERSECT/EXCEPT [ALL]
  •   LIMIT and OFFSET
  •   DEPTH and PATH criteria
  •   REFERENCE criteria
  •   IN and NOT IN
  •   BETWEEN val1 [EXCLUSIVE] AND val2 [EXCLUSIVE]
  •   Arithmetic expressions in criteria

                                                      24
Why use ModeShape?

Sample enhanced JCR-SQL2 queries
 SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006


 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
 WHERE PATH() LIKE $path


 SELECT file.*,content.* FROM [nt:file] AS file
 JOIN [nt:resource] AS content ON ISCHILDNODE(content,file)
 WHERE PATH(file) LIKE '/files/q*.2.vdb'


 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file]
 WHERE PATH() IN (
     SELECT [vdb:originalFile] FROM [vdb:virtualDatabase]
     WHERE [vdb:version] <= $maxVersion
     AND CONTAINS([vdb:description],'xml OR xml maybe')
 )


                                                                                    25
Why use ModeShape?

Use the data you already have
• Repositories frequently store files
  - Many of those files contain structured information
• How do you use what’s inside those files?
  - Download and parse in your application?
  - Rely upon full-text search?
  - Do it whenever the files change?
• ModeShape sequencers get at that info
  - Parsers for various file formats
  - Extract the information and place into graph form using node types
  - Store derived information inside the repository
  - Access, navigate,and query
                                                                    26
Why use ModeShape?

      Sequencer examples

• Web service artifacts
  - WSDL, XSD, WS Policy, ...
• Data management artifacts
  - DDL, Teiid models & VDBs, services, data sources, ...
• Software artifacts
  - JAR, WAR, EAR, POM, manifests, Java source/classfiles, ...
• Rule and process artifacts
  - Business/technical rules, functions, flows, DSLs, ...


                                                                27
Why use ModeShape?

Automatically extract content
                                      5) access


                                              4) store


     1) upload




            2) notify




                          3) derive


             Sequencers



                                                         28
Why use ModeShape?

  ModeShape sequencers
                  (out-of-the-box)

• ZIP, JAR, EAR, and WAR files
• Java class and source files
• DDL files
• Teiid Relational models and VDBs
• Text files (CSV and delimited)
                                     Sequencer API
• JCR Compact Node Definition files      sequencer
                                     implementation
• XML documents
• Microsoft Office® documents
• Image metadata

                                                      29
Why use ModeShape?

 ModeShape components

• JCR engine
• RESTful service
• WebDAV service
• JDBC driver
• JBoss AS 5.1 kit
• Eclipse plugin

                               30
Why use ModeShape?

         RESTful service

• Remote access to repository
• Standard HTTP methods
  - GET repositories
  - GET workspaces
  - GET, PUT, POST, DELETE nodes
  - POST queries
• JSON responses (HTML, XML planned)
• Uses RESTEasy
• Deployed as a WAR
                                       31
Why use ModeShape?

            WebDAV service

• Remote access to repository
• Can mount as network share
• Download, upload, create or delete files
• Navigate, create and delete folders
• Deployed as a WAR



                                            32
Why use ModeShape?

                   JDBC driver

• Query repository via JDBC using JCR-SQL2
• Connects to one workspace
• Can be used in same VM as ModeShape
   jdbc:jcr:jndi:{path/in/jndi}?repositoryName={name}&user=...

• Or in remote VM
   jdbc:jcr:http://{hostname}:{port}/modeshape-rest/?repositoryName={name}&user=...

• Supports result set metadata
• Supports database metadata

                                                                                33
Why use ModeShape?

             JBoss AS kit
•   JCR service (the engine)
•   JOPR plugin for management & monitoring
•   REST service (WAR)
•   WebDAV service (WAR)
•   JAAS authentication & authorization
•   JDBC data source (1 per workspace)
•   JCR API on classpath
•   Sequencers
•   Disk-based storage by default (HSQLDB & Lucene)
•   Packaged as ZIP
•   Script to install into a profile
                                                      34
Why use ModeShape?

JOPR plugin




                     35
Productization

             SOA-P 5.1 EDS
• Includes Teiid & ModeShape
• Slightly customized ModeShape JBoss AS kit
  - modified configuration and select connectors, sequencers
• Repository for data service artifacts
  - relational model files
  - virtual database (VDB) files
• Other files can be managed (but not sequenced)
  - XSD, WSDL, CSV, docs, etc.
• Publish and unpublish from JBoss Dev Studio
• Can access repository content from within VDBs
                                                             36
Productization

                       BRMS 5.1

• Offer ModeShape as an option (in place of Jackrabbit)
• Same binaries as in SOA-P 5.1
• Enable future enhancements (if desired):
  -   sequencers for rules, flows, DSLs, etc.
  -   query via JDBC
  -   connectors & federation
  -   RESTful access




                                                      37
Questions?

More Related Content

What's hot

Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiJukka Zitting
 
Functional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackFunctional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackMohammad Sabir Khan
 
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf정민 안
 
Reussir mon depot HAL
Reussir mon depot HALReussir mon depot HAL
Reussir mon depot HALOAccsd
 
Identity in ASP.NET Core
Identity in ASP.NET CoreIdentity in ASP.NET Core
Identity in ASP.NET Coreondrejbalas
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with EclipseChris Aniszczyk
 
Ksh portfolio
Ksh portfolioKsh portfolio
Ksh portfolioSunhoKo2
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansWindzoon Technologies
 
Introduction to Ionic framework
Introduction to Ionic frameworkIntroduction to Ionic framework
Introduction to Ionic frameworkShyjal Raazi
 
QWeb Report in odoo
QWeb Report in odooQWeb Report in odoo
QWeb Report in odooexpertodoo
 
Oracle Forms: Master Detail form
Oracle Forms: Master Detail formOracle Forms: Master Detail form
Oracle Forms: Master Detail formSekhar Byna
 
Content Management With Apache Jackrabbit
Content Management With Apache JackrabbitContent Management With Apache Jackrabbit
Content Management With Apache JackrabbitJukka Zitting
 
Java design patterns
Java design patternsJava design patterns
Java design patternsShawn Brito
 

What's hot (20)

Java Spring
Java SpringJava Spring
Java Spring
 
Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache Jackrabbi
 
Functional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and LogbackFunctional Application Logging : Code Examples Using Spring Boot and Logback
Functional Application Logging : Code Examples Using Spring Boot and Logback
 
Forms 6i guide
Forms 6i guideForms 6i guide
Forms 6i guide
 
Laravel Eloquent ORM
Laravel Eloquent ORMLaravel Eloquent ORM
Laravel Eloquent ORM
 
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
20221131_레츠스위프트_2022_iOS개발에서_알아두면_좋은것들.pdf
 
J query fundamentals
J query fundamentalsJ query fundamentals
J query fundamentals
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
 
Reussir mon depot HAL
Reussir mon depot HALReussir mon depot HAL
Reussir mon depot HAL
 
Identity in ASP.NET Core
Identity in ASP.NET CoreIdentity in ASP.NET Core
Identity in ASP.NET Core
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with Eclipse
 
Ksh portfolio
Ksh portfolioKsh portfolio
Ksh portfolio
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Introduction to Ionic framework
Introduction to Ionic frameworkIntroduction to Ionic framework
Introduction to Ionic framework
 
Git basic
Git basicGit basic
Git basic
 
QWeb Report in odoo
QWeb Report in odooQWeb Report in odoo
QWeb Report in odoo
 
Oracle Forms: Master Detail form
Oracle Forms: Master Detail formOracle Forms: Master Detail form
Oracle Forms: Master Detail form
 
Content Management With Apache Jackrabbit
Content Management With Apache JackrabbitContent Management With Apache Jackrabbit
Content Management With Apache Jackrabbit
 
PHP Composer Basics
PHP Composer BasicsPHP Composer Basics
PHP Composer Basics
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 

Viewers also liked

ModeShape 3 overview
ModeShape 3 overviewModeShape 3 overview
ModeShape 3 overviewRandall Hauch
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
 
SharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and ConfigurationSharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and ConfigurationAdobe
 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 fullMichael Marth
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
Hosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRHosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRWoonsan Ko
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content RepositoriesCarsten Ziegeler
 
JPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à AchillesJPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à AchillesIppon
 

Viewers also liked (11)

Introduction to JCR
Introduction to JCR Introduction to JCR
Introduction to JCR
 
ModeShape 3 overview
ModeShape 3 overviewModeShape 3 overview
ModeShape 3 overview
 
JCR In 10 Minutes
JCR In 10 MinutesJCR In 10 Minutes
JCR In 10 Minutes
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
 
SharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and ConfigurationSharePoint Connector – Setup and Configuration
SharePoint Connector – Setup and Configuration
 
Aem hub oak 0.2 full
Aem hub oak 0.2 fullAem hub oak 0.2 full
Aem hub oak 0.2 full
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
Hosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCRHosting huge amount of binaries in JCR
Hosting huge amount of binaries in JCR
 
JCR - Java Content Repositories
JCR - Java Content RepositoriesJCR - Java Content Repositories
JCR - Java Content Repositories
 
JPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à AchillesJPA avec Cassandra, grâce à Achilles
JPA avec Cassandra, grâce à Achilles
 
AgilePM® - Agile Project Management - Foundation
AgilePM® - Agile Project Management - FoundationAgilePM® - Agile Project Management - Foundation
AgilePM® - Agile Project Management - Foundation
 

Similar to An Overview of ModeShape

Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloJulian Arocena
 
What is persistence in java
What is persistence in javaWhat is persistence in java
What is persistence in javaBenjamin Kim
 
JSON in der Oracle Datenbank
JSON in der Oracle DatenbankJSON in der Oracle Datenbank
JSON in der Oracle DatenbankUlrike Schwinn
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabadrevanthonline
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systexJames Chen
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillDataWorks Summit
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchMapR Technologies
 
Serialization and performance by Sergey Morenets
Serialization and performance by Sergey MorenetsSerialization and performance by Sergey Morenets
Serialization and performance by Sergey MorenetsAlex Tumanoff
 
Best Java Online Training in India
Best Java Online Training in IndiaBest Java Online Training in India
Best Java Online Training in IndiaNagendra Kumar
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
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 2011Arun Gupta
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Railsiradarji
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiSoftware Guru
 

Similar to An Overview of ModeShape (20)

Introduction to CQ5
Introduction to CQ5Introduction to CQ5
Introduction to CQ5
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
 
What is persistence in java
What is persistence in javaWhat is persistence in java
What is persistence in java
 
J2EE Online Training
J2EE Online TrainingJ2EE Online Training
J2EE Online Training
 
JSON in der Oracle Datenbank
JSON in der Oracle DatenbankJSON in der Oracle Datenbank
JSON in der Oracle Datenbank
 
Java Classroom Training
Java Classroom TrainingJava Classroom Training
Java Classroom Training
 
Java Online Training
Java Online TrainingJava Online Training
Java Online Training
 
Java online training from hyderabad
Java online training from hyderabadJava online training from hyderabad
Java online training from hyderabad
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache Drill
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 March
 
Introduction to Apache Drill
Introduction to Apache DrillIntroduction to Apache Drill
Introduction to Apache Drill
 
Serialization and performance by Sergey Morenets
Serialization and performance by Sergey MorenetsSerialization and performance by Sergey Morenets
Serialization and performance by Sergey Morenets
 
Best Java Online Training in India
Best Java Online Training in IndiaBest Java Online Training in India
Best Java Online Training in India
 
Java Online Training
Java Online TrainingJava Online Training
Java Online Training
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
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
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para TiGustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
Gustavo Garnica: Evolución de la Plataforma Java y lo que Significa para Ti
 
Hibernate
HibernateHibernate
Hibernate
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

An Overview of ModeShape

  • 1. An Overview of ModeShape September 2010 modeshape.org
  • 2. Topics • Why use JCR? • Why use ModeShape? • Productization 2
  • 3. What is JCR? JSR-170 and JSR-283 • Standard programmatic API: javax.jcr • Abstracts where/how the content is stored • Best features from databases and file systems Image credit: David Nuescheler 3
  • 4. Typical uses of JCR • Content management systems • Portals (e.g., GateIn) • Knowledge bases • Test management systems • Artifact repositories (e.g., BRMS, EDS, ...) 4
  • 5. Why use a JCR repository? • Flexible data structure - because your data will change • Hierarchical graph-based storage - natural organization - flexible schema - handles wide variety of content • Search & query • Versioning, events, access control, referential integrity, locking • Standard API 5
  • 6. Fundamental elements of JCR Repository Workspacen Namespace Registry Node Type Manager Sessionm Sessionmm Session Sessionm Version Sessionm Sessionm Nodes Manager Lock Manager other services 6
  • 7. Why use JCR? Hierarchical organization • Great for natural hierarchies - URLs and file systems - Dates - Composition - Catalogs - ... many others • Examples - Files and folders (artifacts) - Database schemas - Web services - XML, YAML, JSON, etc. 7
  • 8. Why use JCR? Flexible schema (part 1) Each JCR node has: • Name, path, & identifier • Properties - name & value(s) Status Report.pdf - jcr:primaryType nt:file property types jcr:mixinTypes [acme:tagged] • Child nodes jcr:createdBy jsmith jcr:created 2010-07-31T08:10:14 - same-name-siblings acme:tags ["status", "projectX"] - may be ordered • One or more node types - primary type and mixins - dictate whether properties and children can be added/removed - can be changed at any time on each node 8
  • 9. Why use JCR? Flexible schema (part 2) JCR node types: • define the allowed properties - name (or unrestricted with “*”) LONG, DOUBLE, DECIMAL, DATE, - type BOOLEAN, NAME, - number of values PATH, URI, - searchability REFERENCE, WEAK_REFERENCE, - mandatory UNDEFINED • define the allowed child nodes - name (or unrestricted with “*”) - required node types - same-name-siblings allowed • inheritance and mixed together 9
  • 10. Why use JCR? Query languages • XPath From JCR 1.0, deprecated in JCR 2.0 • JCR-SQL • JCR-SQL2 New in JCR 2.0 • JCR-JQOM 10
  • 11. Why use JCR? JCR-SQL2 is based upon SQL JCR-SQL2 SQL node type table property column node row Nodes appear as rows in those tables that correspond to the node’s types - a node can appear as a row in multiple tables - often a complete picture of a node requires joining multiple tables - other joins are possible, such as ancestors, descendants, equivalent properties 11
  • 12. Why use JCR? JCR-SQL2 features • Select • Joins (INNER, LEFT/RIGHT OUTER) • Property & name criteria • Child & descendant node criteria • Comparison operators (=,<,<=,>,>=,<>, LIKE) • Logical operators (AND, OR, NOT) • Full-text search criteria • Variables ModeShape accepts all valid JCR-SQL2 queries 12
  • 13. Why use JCR? Sample JCR-SQL2 queries SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE NAME() LIKE $name SELECT file.*,content.* FROM [nt:file] AS file JOIN [nt:resource] AS content ON ISCHILDNODE(content,file) WHERE NAME(file) LIKE 'q*.2.vdb' 13
  • 14. Why use JCR? Other benefits • Versioning • Notification (events) • Access control • Referential integrity • Locking • Standard API 14
  • 15. Using JCR 2.0 repositories • Uses JCR 2.0 API & Java SE ServiceLoader • No implementation dependencies Java code: Properties parameters = new Properties(); parameters.load(...); // load from a file Repository repository = null; for (RepositoryFactory factory : ServiceLoader.load(RepositoryFactory.class)) { repository = factory.getRepository(parameters); if (repository != null) break; } Properties for ModeShape: org.modeshape.jcr.URL = file:path/to/configRepository.xml?repositoryName=MyRepository or org.modeshape.jcr.URL = jndi:/jcr/local?repositoryName=MyRepository 15
  • 16. Why use ModeShape? • Supports JCR 2.0 • Storage options • Access existing content thru JCR • Unified repository via federation • Automatically derives content • Lightweight, embeddable & clusterable • Plays well with JBoss AS 16
  • 17. Why use ModeShape? Storage options JCR Client Application • Store content where it JCR API makes sense for your application ModeShape JCR Repository • Multiple connectors out-of-the-box ? • Easy enough to write your own ? Transient Infinispan JBoss JDBC File SVN Other in-memory data grid Cache Database System repository systems storage for storage for storage for storage 17
  • 18. Why use ModeShape? Storage examples • Store in RDBMS using Hibernate - Conventional and well-understood • Store in Infinispan - Scalability, fault tolerance and speed of a data grid • Store artifacts on file system - Images, documents, downloads, static pages, etc. - Serve files via file system, bypassing JCR altogether - Manipulate content through JCR (e.g., CMS) • Transient in-memory - Lightweight and fast for embedded uses - Often used with imported data 18
  • 19. Why use ModeShape? Accessing other data JCR Client Application • Use JCR API to JCR API access data from other systems ModeShape JCR Repository • Leave the data where it is ? • Just another connector ? JCR JDBC File SVN Other repositories Database System repository systems schema 19
  • 20. Why use ModeShape? Access examples • Access files already stored on file system - Use the JCR API within your application - Use search and query • Access database metadata (live) - Leverage session-based caching - Consistent model • Access (& manipulate) content in other JCRs - Got data already in another JCR system? - Makes most sense with federation ... 20
  • 21. Why use ModeShape? Federation JCR Client • Use JCR API to Application access a virtual, JCR API unified repository ModeShape • Leave the data Federated where it is Repository ? Transient JBoss Infinispan JDBC JDBC File SVN Other in-memory Cache data grid Database Database System repository systems storage for storage for storage for storage schema 21
  • 22. Why use ModeShape? Federation examples • Own some content, access other data - Use the JCR API consistently throughout your application - Single virtual and unified repository - Leverage JCR’s flexible schema - Use search and query across all data - Leave existing data where it lives • Use the best data store for each kind of data - Use the JCR API consistently throughout your application - Single virtual and unified repository - Match access and capabilities with requirements 22
  • 23. Why use ModeShape? Query languages • XPath From JCR 1.0, deprecated in JCR 2.0 • JCR-SQL • JCR-SQL2 New in JCR 2.0 • JCR-JQOM • Full-text search Like web search engines, based on JCR-SQL2’s full-text search expression grammar Separate parsers, but all use the same canonical AST, planner, optimizer, and processor 23
  • 24. Why use ModeShape? Enhanced JCR-SQL2 ModeShape accepts all valid JCR-SQL2 queries, plus: • Additional joins (FULL OUTER, CROSS) • Subqueries in criteria • SELECT [DISTINCT] • UNION/INTERSECT/EXCEPT [ALL] • LIMIT and OFFSET • DEPTH and PATH criteria • REFERENCE criteria • IN and NOT IN • BETWEEN val1 [EXCLUSIVE] AND val2 [EXCLUSIVE] • Arithmetic expressions in criteria 24
  • 25. Why use ModeShape? Sample enhanced JCR-SQL2 queries SELECT * FROM [car:Car] WHERE [car:model] LIKE ‘%Toyota%’ AND [car:year] >= 2006 SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE PATH() LIKE $path SELECT file.*,content.* FROM [nt:file] AS file JOIN [nt:resource] AS content ON ISCHILDNODE(content,file) WHERE PATH(file) LIKE '/files/q*.2.vdb' SELECT [jcr:primaryType],[jcr:created],[jcr:createdBy] FROM [nt:file] WHERE PATH() IN ( SELECT [vdb:originalFile] FROM [vdb:virtualDatabase] WHERE [vdb:version] <= $maxVersion AND CONTAINS([vdb:description],'xml OR xml maybe') ) 25
  • 26. Why use ModeShape? Use the data you already have • Repositories frequently store files - Many of those files contain structured information • How do you use what’s inside those files? - Download and parse in your application? - Rely upon full-text search? - Do it whenever the files change? • ModeShape sequencers get at that info - Parsers for various file formats - Extract the information and place into graph form using node types - Store derived information inside the repository - Access, navigate,and query 26
  • 27. Why use ModeShape? Sequencer examples • Web service artifacts - WSDL, XSD, WS Policy, ... • Data management artifacts - DDL, Teiid models & VDBs, services, data sources, ... • Software artifacts - JAR, WAR, EAR, POM, manifests, Java source/classfiles, ... • Rule and process artifacts - Business/technical rules, functions, flows, DSLs, ... 27
  • 28. Why use ModeShape? Automatically extract content 5) access 4) store 1) upload 2) notify 3) derive Sequencers 28
  • 29. Why use ModeShape? ModeShape sequencers (out-of-the-box) • ZIP, JAR, EAR, and WAR files • Java class and source files • DDL files • Teiid Relational models and VDBs • Text files (CSV and delimited) Sequencer API • JCR Compact Node Definition files sequencer implementation • XML documents • Microsoft Office® documents • Image metadata 29
  • 30. Why use ModeShape? ModeShape components • JCR engine • RESTful service • WebDAV service • JDBC driver • JBoss AS 5.1 kit • Eclipse plugin 30
  • 31. Why use ModeShape? RESTful service • Remote access to repository • Standard HTTP methods - GET repositories - GET workspaces - GET, PUT, POST, DELETE nodes - POST queries • JSON responses (HTML, XML planned) • Uses RESTEasy • Deployed as a WAR 31
  • 32. Why use ModeShape? WebDAV service • Remote access to repository • Can mount as network share • Download, upload, create or delete files • Navigate, create and delete folders • Deployed as a WAR 32
  • 33. Why use ModeShape? JDBC driver • Query repository via JDBC using JCR-SQL2 • Connects to one workspace • Can be used in same VM as ModeShape jdbc:jcr:jndi:{path/in/jndi}?repositoryName={name}&user=... • Or in remote VM jdbc:jcr:http://{hostname}:{port}/modeshape-rest/?repositoryName={name}&user=... • Supports result set metadata • Supports database metadata 33
  • 34. Why use ModeShape? JBoss AS kit • JCR service (the engine) • JOPR plugin for management & monitoring • REST service (WAR) • WebDAV service (WAR) • JAAS authentication & authorization • JDBC data source (1 per workspace) • JCR API on classpath • Sequencers • Disk-based storage by default (HSQLDB & Lucene) • Packaged as ZIP • Script to install into a profile 34
  • 36. Productization SOA-P 5.1 EDS • Includes Teiid & ModeShape • Slightly customized ModeShape JBoss AS kit - modified configuration and select connectors, sequencers • Repository for data service artifacts - relational model files - virtual database (VDB) files • Other files can be managed (but not sequenced) - XSD, WSDL, CSV, docs, etc. • Publish and unpublish from JBoss Dev Studio • Can access repository content from within VDBs 36
  • 37. Productization BRMS 5.1 • Offer ModeShape as an option (in place of Jackrabbit) • Same binaries as in SOA-P 5.1 • Enable future enhancements (if desired): - sequencers for rules, flows, DSLs, etc. - query via JDBC - connectors & federation - RESTful access 37