SlideShare una empresa de Scribd logo
Presentador Edwin Guilbert
Recorrido por el Content Repository API para Java (JCR),
analizando JackRabbit.
20 de Mayo, 2015
JCR
¿QUÉ ES JCR?
!
Content Repository API para Java:
!
CMS
Java Standard: JSR-170, JSR-283
Object database para guardar, buscar y obtener datos
jerárquicos
Java Package: javax.jcr
¿QUÉ ES JACKRABBIT?
!
Implementación de referencia de JCR:
!
!
Session
Repository
Node
NODE TYPES
!
Define los nodos hijo y sus propiedades. Sirve de modelo de
contenidos para aplicaciones:
!
Primary type: Estructura del nodo. Propiedades, hijos,
herencia
!
Mixin: Capacidad con propiedades o nodos hijos
Primary: Product
<nodeTypes
xmlns:rep="internal"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"
xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!-- custom node types -->
<nodeType name="mgnl:product" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
<supertypes>
<supertype>mgnl:content</supertype>
</supertypes>
</nodeType>
</nodeTypes>
Primary: Content
<nodeType name="mgnl:contentNode" isMixin="false" hasOrderableChildNodes="true"
primaryItemName="">
<supertypes>
<supertype>nt:hierarchyNode</supertype>
<supertype>mix:referenceable</supertype>
<supertype>mgnl:created</supertype>
<supertype>mgnl:activatable</supertype>
<supertype>mgnl:lastModified</supertype>
<supertype>mgnl:renderable</supertype>
</supertypes>
<childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>nt:base</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
<propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" multiple="false"/>
<propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" multiple="true"/>
</nodeType>
Mixin: Created
<nodeType name="mgnl:created" isMixin=“true">
!
<supertypes>
<supertype>nt:base</supertype>
</supertypes>
!
<propertyDefinition name="mgnl:created" requiredType="Date"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple=“false"/>
!
<propertyDefinition name="mgnl:createdBy" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple=“false"/>
!
</nodeType>
BENEFICIOS DE JCR
Estructura Jerárquica
Observación
Búsqueda
Versionado
Exportar
Importar
Ordenamiento
Seguridad
ESTRUCTURA JERÁRQUICA
Los datos en JCR consisten en un árbol de nodos con
propiedades asociadas:
!
Los datos se almacenan en propiedades
Strings o datos binarios
Un nodo puede tener uno o mas NodeTypes asociados
Propiedad especial que permite referenciar nodos entre sí
Herencia/Integridad referencial
JCR+API
REPOSITORIO Y WORKSPACES
!
!
Carpetas comparables con nodos
!
Ficheros comparables con
propiedades
!
Navegación por path:
/A/B/property
OBSERVACIÓN
!
Permite a las aplicaciones recibir notificaciones sobre
cambios en un workspace:
!
Modelo de eventos
Tipos de evento: Agregar, remover, persistir
Propiedades de evento: Path, identificador, usuario, fecha
ObservationManager:addEventListener
!
ObservationUtil.registerDeferredChangeListener(
RepositoryConstants.CONFIG,
SERVER_FILTERS,
filtersEventListener,
1000,
5000);
!
!
ObservationManager observationManager = getObservationManager(workspace);
!
observationManager.addEventListener(listener, eventTypesMask,
observationPath, includeSubnodes, null, nodeTypes, false);
EventListener por Workspace
!
public class CommandEventListener implements EventListener {
!
public void onEvent(EventIterator events) {
!
while (events.hasNext()) {
!
event = events.nextEvent();
!
path = getPath(event);
!
Context executionCtx = this.createContext();
!
executionCtx.put(Context.ATTRIBUTE_PATH, path);
!
getCommand().execute(executionCtx);
}
}
}
BÚSQUEDA
!
JSR-283 establece que se debe soportar una forma
estandarizada de SQL:
!
Abstract Query Model
Lenguajes: JCR-SQL2 y JCR-JQOM
Semántica: Selectores, Joins, Constraints, Orderings,
Query results
JCR Query Cheat Sheet
VERSIONADO
El versionado permite al usuario guardar y restaurar el estado
de un nodo y su sub-árbol:
!
Version
<mix:versionable> subtipo de <mix:referenceable>
Checkin, checkout y checkpoint
VersionHistory / VersionStorage
Base version
Frozen nodes
protected Version createVersion(Node node, Rule rule, String userName)
throws UnsupportedRepositoryOperationException,
RepositoryException {
!
node.addMixin(“mix:versionable");
node.addMixin.save();
!
// add version
Version newVersion = node.checkin();
node.checkout();
!
}
!
BaseVersionManager: createVersion
public synchronized void restore(final Node node, Version version,
boolean removeExisting)
throws VersionException, UnsupportedRepositoryOperationException,
RepositoryException {
!
!
node.restore(unwrappedVersion, removeExisting);
!
node.checkout();
!
!
}
BaseVersionManager: restore
IMPORTAR / EXPORTAR
JCR provee serialización convirtiendo a XML el contenido del
workspace sin pérdida de información:
!
XML refleja estructura jerárquica de JCR
Namespace: sv: http://www.jcp.org/jcr/sv/1.0
Nodos se convierten en <sv:node>
Propiedades se convierten en <sv:property>
Nombres se convierten en atributo sv:name=“”
!
!
!
Session session = ws.getSession();
!
!
session.importXML(basepath, xmlStream, importMode);
!
!
session.exportSystemView(basepath, outputStream, false, false);
DataTransporter: import export
ORDENAMIENTO
!
JCR permite que los nodos tengan un ordenamiento dentro
del árbol jerárquico:
!
Propiedades no son ordenables
<nodeType name="mgnl:content" hasOrderableChildNodes=“true">
Node.getNodes() siempre tiene un orden
El nodo padre ordena a sus hijos
!
!
!
public static void orderBefore(Node node, String siblingName)
throws RepositoryException {
!
node.getParent().orderBefore(node.getName(), siblingName);
!
}
!
!
!
NodeUtil: orderBefore
SEGURIDAD
!
JCR permite la gestión de control de acceso en el repositorio:
!
AccessControlManager
Privilegios que un usuario tiene sobre un nodo
jcr:read Obtener un nodo y sus propiedades
jcr:write Modificar propiedades, agregar/eliminar nodos
Roles provide fine-grained access
controls for both Apps and site URLs
public void addPermission(final Role role, final String workspace, final
String path, final long permission) {
!
Node roleNode = session.getNodeByIdentifier(role.getId());
Node aclNode = getAclNode(roleNode, workspace);
if (!existsPermission(aclNode, path, permission)) {
String nodeName = Path.getUniqueLabel(session, aclNode.getPath(), "0");
Node node = aclNode.addNode(nodeName, NodeTypes.ContentNode.NAME);
node.setProperty("path", path);
node.setProperty("permissions", permission);
session.save();
}
!
}
MgnlRoleManager: addPermission
BUSINESS APPS

Más contenido relacionado

La actualidad más candente

분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
MongoDB
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
VMware Tanzu Korea
 
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
Amazon Web Services Korea
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101
KubeAcademy
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitJukka Zitting
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
Gabriel Carro
 
Kubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystemKubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam
 
Apache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex HuangApache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex Huangbuildacloud
 
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
Myungjin Lee
 
VMware Advance Troubleshooting Workshop - Day 3
VMware Advance Troubleshooting Workshop - Day 3VMware Advance Troubleshooting Workshop - Day 3
VMware Advance Troubleshooting Workshop - Day 3
Vepsun Technologies
 
Istio presentation jhug
Istio presentation jhugIstio presentation jhug
Istio presentation jhug
Georgios Andrianakis
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
Georg Ember
 
GT.M: A Tried and Tested Open-Source NoSQL Database
GT.M: A Tried and Tested Open-Source NoSQL DatabaseGT.M: A Tried and Tested Open-Source NoSQL Database
GT.M: A Tried and Tested Open-Source NoSQL Database
Rob Tweed
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
Araf Karsh Hamid
 
IBM PowerVM Best Practices
IBM PowerVM Best PracticesIBM PowerVM Best Practices
IBM PowerVM Best Practices
IBM India Smarter Computing
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
Will Hall
 
파이널프로젝트 발표자료 Ob_20211101 (2)
파이널프로젝트 발표자료 Ob_20211101 (2)파이널프로젝트 발표자료 Ob_20211101 (2)
파이널프로젝트 발표자료 Ob_20211101 (2)
kangsumin
 
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
XpressEngine
 

La actualidad más candente (20)

분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
분산 트랜잭션 - 큰힘에는 큰 책임이 따른다 [MongoDB]
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
 
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
게임을 위한 DynamoDB 사례 및 팁 - 김일호 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache Jackrabbit
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 
Kubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystemKubernetes design principles, patterns and ecosystem
Kubernetes design principles, patterns and ecosystem
 
Apache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex HuangApache CloudStack Architecture by Alex Huang
Apache CloudStack Architecture by Alex Huang
 
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
 
Rich domain model
Rich domain modelRich domain model
Rich domain model
 
VMware Advance Troubleshooting Workshop - Day 3
VMware Advance Troubleshooting Workshop - Day 3VMware Advance Troubleshooting Workshop - Day 3
VMware Advance Troubleshooting Workshop - Day 3
 
Istio presentation jhug
Istio presentation jhugIstio presentation jhug
Istio presentation jhug
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
 
GT.M: A Tried and Tested Open-Source NoSQL Database
GT.M: A Tried and Tested Open-Source NoSQL DatabaseGT.M: A Tried and Tested Open-Source NoSQL Database
GT.M: A Tried and Tested Open-Source NoSQL Database
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
IBM PowerVM Best Practices
IBM PowerVM Best PracticesIBM PowerVM Best Practices
IBM PowerVM Best Practices
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
 
파이널프로젝트 발표자료 Ob_20211101 (2)
파이널프로젝트 발표자료 Ob_20211101 (2)파이널프로젝트 발표자료 Ob_20211101 (2)
파이널프로젝트 발표자료 Ob_20211101 (2)
 
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
XECon+PHPFest2014 발표자료 - ElasticSearch를 이용한 통합검색 구축방법 - 김훈민
 

Similar a Recorrido por el Content Repository API para Java (JCR), analizando JackRabbit

SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVCSEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
Paradigma Digital
 
Java para android developers
Java para android developersJava para android developers
Java para android developersjose diaz
 
Hands-on Spring 3: The next generation
Hands-on Spring 3: The next generationHands-on Spring 3: The next generation
Hands-on Spring 3: The next generationSergi Almar i Graupera
 
Software Líbre con respaldo de Oracle ~ OTN Tour 2013
Software Líbre con respaldo de Oracle ~ OTN Tour 2013Software Líbre con respaldo de Oracle ~ OTN Tour 2013
Software Líbre con respaldo de Oracle ~ OTN Tour 2013Mysql Latinoamérica
 
Software Open Source – Open Day Oracle 2013
Software Open Source – Open Day Oracle 2013Software Open Source – Open Day Oracle 2013
Software Open Source – Open Day Oracle 2013
Erik Gur
 
Plataforma de programación Java
Plataforma de programación JavaPlataforma de programación Java
Plataforma de programación Java
Antonio Contreras
 
Marcos quesada caching_sf2
Marcos quesada caching_sf2Marcos quesada caching_sf2
Marcos quesada caching_sf2
symfony_bcn
 
Esencia de Web Components
Esencia de Web ComponentsEsencia de Web Components
Esencia de Web Components
Pedro J. Molina
 
TABLA DE COMANDO /SENTENCIAS/PAQUETES
TABLA DE COMANDO /SENTENCIAS/PAQUETESTABLA DE COMANDO /SENTENCIAS/PAQUETES
TABLA DE COMANDO /SENTENCIAS/PAQUETES
Yarker Castillo del Rosario
 
Esencia de web components
Esencia de web componentsEsencia de web components
Esencia de web components
Pedro J. Molina
 
Introducción a Tomcat
Introducción a TomcatIntroducción a Tomcat
Introducción a Tomcat
Iker Canarias
 
MySQL Team – Open Day Oracle 2013
MySQL Team – Open Day Oracle 2013MySQL Team – Open Day Oracle 2013
MySQL Team – Open Day Oracle 2013
Erik Gur
 
Introducción a Java y BEA (2008)
Introducción a Java y BEA (2008)Introducción a Java y BEA (2008)
Introducción a Java y BEA (2008)
Isidro José López Martínez
 
Manual desarrollo de aplicaciones web ii
Manual desarrollo de aplicaciones web iiManual desarrollo de aplicaciones web ii
Manual desarrollo de aplicaciones web ii
Karina Villavicencio
 
Jvmmx docker jvm
Jvmmx docker jvmJvmmx docker jvm
Jvmmx docker jvm
superserch
 
Spring framework 3
Spring framework 3Spring framework 3
Spring framework 3
Oliver Centeno
 

Similar a Recorrido por el Content Repository API para Java (JCR), analizando JackRabbit (20)

SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVCSEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
SEMINARIO: Servicios REST. Bases de la tecnología y soporte con Spring MVC
 
Java para android developers
Java para android developersJava para android developers
Java para android developers
 
Hands-on Spring 3: The next generation
Hands-on Spring 3: The next generationHands-on Spring 3: The next generation
Hands-on Spring 3: The next generation
 
Software Líbre con respaldo de Oracle ~ OTN Tour 2013
Software Líbre con respaldo de Oracle ~ OTN Tour 2013Software Líbre con respaldo de Oracle ~ OTN Tour 2013
Software Líbre con respaldo de Oracle ~ OTN Tour 2013
 
Software Open Source – Open Day Oracle 2013
Software Open Source – Open Day Oracle 2013Software Open Source – Open Day Oracle 2013
Software Open Source – Open Day Oracle 2013
 
Curso richfaces 3.3.3 I
Curso richfaces 3.3.3 ICurso richfaces 3.3.3 I
Curso richfaces 3.3.3 I
 
Plataforma de programación Java
Plataforma de programación JavaPlataforma de programación Java
Plataforma de programación Java
 
Marcos quesada caching_sf2
Marcos quesada caching_sf2Marcos quesada caching_sf2
Marcos quesada caching_sf2
 
06. jsf (java server faces) (1)
06. jsf (java server faces) (1)06. jsf (java server faces) (1)
06. jsf (java server faces) (1)
 
Esencia de Web Components
Esencia de Web ComponentsEsencia de Web Components
Esencia de Web Components
 
My sql ha-fina_lv2
My sql ha-fina_lv2My sql ha-fina_lv2
My sql ha-fina_lv2
 
TABLA DE COMANDO /SENTENCIAS/PAQUETES
TABLA DE COMANDO /SENTENCIAS/PAQUETESTABLA DE COMANDO /SENTENCIAS/PAQUETES
TABLA DE COMANDO /SENTENCIAS/PAQUETES
 
Esencia de web components
Esencia de web componentsEsencia de web components
Esencia de web components
 
Introducción a Tomcat
Introducción a TomcatIntroducción a Tomcat
Introducción a Tomcat
 
MySQL Team – Open Day Oracle 2013
MySQL Team – Open Day Oracle 2013MySQL Team – Open Day Oracle 2013
MySQL Team – Open Day Oracle 2013
 
Introducción a Java y BEA (2008)
Introducción a Java y BEA (2008)Introducción a Java y BEA (2008)
Introducción a Java y BEA (2008)
 
Manual desarrollo de aplicaciones web ii
Manual desarrollo de aplicaciones web iiManual desarrollo de aplicaciones web ii
Manual desarrollo de aplicaciones web ii
 
Jvmmx docker jvm
Jvmmx docker jvmJvmmx docker jvm
Jvmmx docker jvm
 
Jsf
JsfJsf
Jsf
 
Spring framework 3
Spring framework 3Spring framework 3
Spring framework 3
 

Más de Magnolia

The SEO Workflow
The SEO WorkflowThe SEO Workflow
The SEO Workflow
Magnolia
 
Magnolia 6 release walkthrough
Magnolia 6 release walkthroughMagnolia 6 release walkthrough
Magnolia 6 release walkthrough
Magnolia
 
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Buzzword bingo: The real deal behind  omnichannel, personalization and headlessBuzzword bingo: The real deal behind  omnichannel, personalization and headless
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Magnolia
 
Developing Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficientlyDeveloping Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficiently
Magnolia
 
Integrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer ExperienceIntegrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer Experience
Magnolia
 
Customer Engagement in the Digital Era
Customer Engagement in the Digital EraCustomer Engagement in the Digital Era
Customer Engagement in the Digital Era
Magnolia
 
The Age of the IOT & Digital Business
The Age of the IOT & Digital BusinessThe Age of the IOT & Digital Business
The Age of the IOT & Digital Business
Magnolia
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices Architecture
Magnolia
 
A modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at Atlassian
Magnolia
 
Magnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynoteMagnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynote
Magnolia
 
Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4
Magnolia
 
Launching Magnolia on demand
Launching Magnolia on demandLaunching Magnolia on demand
Launching Magnolia on demand
Magnolia
 
Front-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites fasterFront-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites faster
Magnolia
 
Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?
Magnolia
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOT
Magnolia
 
Internationalization for globalized enterprise websites
Internationalization for globalized enterprise websitesInternationalization for globalized enterprise websites
Internationalization for globalized enterprise websites
Magnolia
 
The new visana website how to fit a square peg into a round hole
The new visana website   how to fit a square peg into a round holeThe new visana website   how to fit a square peg into a round hole
The new visana website how to fit a square peg into a round hole
Magnolia
 
Solving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approachSolving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approach
Magnolia
 
Extending Magnolia with our solutions
Extending Magnolia with our solutionsExtending Magnolia with our solutions
Extending Magnolia with our solutions
Magnolia
 
Boost your online e commerce with magnolia
Boost your online e commerce with magnoliaBoost your online e commerce with magnolia
Boost your online e commerce with magnolia
Magnolia
 

Más de Magnolia (20)

The SEO Workflow
The SEO WorkflowThe SEO Workflow
The SEO Workflow
 
Magnolia 6 release walkthrough
Magnolia 6 release walkthroughMagnolia 6 release walkthrough
Magnolia 6 release walkthrough
 
Buzzword bingo: The real deal behind omnichannel, personalization and headless
Buzzword bingo: The real deal behind  omnichannel, personalization and headlessBuzzword bingo: The real deal behind  omnichannel, personalization and headless
Buzzword bingo: The real deal behind omnichannel, personalization and headless
 
Developing Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficientlyDeveloping Magnolia based sites correctly, quickly and efficiently
Developing Magnolia based sites correctly, quickly and efficiently
 
Integrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer ExperienceIntegrating e-Commerce into your Customer Experience
Integrating e-Commerce into your Customer Experience
 
Customer Engagement in the Digital Era
Customer Engagement in the Digital EraCustomer Engagement in the Digital Era
Customer Engagement in the Digital Era
 
The Age of the IOT & Digital Business
The Age of the IOT & Digital BusinessThe Age of the IOT & Digital Business
The Age of the IOT & Digital Business
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices Architecture
 
A modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at Atlassian
 
Magnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynoteMagnolia Conference 2015 - Pascal Mangold's keynote
Magnolia Conference 2015 - Pascal Mangold's keynote
 
Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4Product keynote - introducing Magnolia 5.4
Product keynote - introducing Magnolia 5.4
 
Launching Magnolia on demand
Launching Magnolia on demandLaunching Magnolia on demand
Launching Magnolia on demand
 
Front-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites fasterFront-end developers - build Magnolia sites faster
Front-end developers - build Magnolia sites faster
 
Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?Magnolia and beacons: how do they work best together?
Magnolia and beacons: how do they work best together?
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOT
 
Internationalization for globalized enterprise websites
Internationalization for globalized enterprise websitesInternationalization for globalized enterprise websites
Internationalization for globalized enterprise websites
 
The new visana website how to fit a square peg into a round hole
The new visana website   how to fit a square peg into a round holeThe new visana website   how to fit a square peg into a round hole
The new visana website how to fit a square peg into a round hole
 
Solving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approachSolving for complex UI designs: a front-end perspective and approach
Solving for complex UI designs: a front-end perspective and approach
 
Extending Magnolia with our solutions
Extending Magnolia with our solutionsExtending Magnolia with our solutions
Extending Magnolia with our solutions
 
Boost your online e commerce with magnolia
Boost your online e commerce with magnoliaBoost your online e commerce with magnolia
Boost your online e commerce with magnolia
 

Último

PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdfPC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
JhenryHuisa1
 
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdfIntroducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
AbbieDominguezGirond
 
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptxTECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
KatiuskaDominguez2
 
Arquitectura de Sistema de Reservaciones
Arquitectura de Sistema de ReservacionesArquitectura de Sistema de Reservaciones
Arquitectura de Sistema de Reservaciones
AlanL15
 
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJECONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
SamuelGampley
 
primer manual de nuestra compañía de soporte
primer manual de nuestra compañía de soporteprimer manual de nuestra compañía de soporte
primer manual de nuestra compañía de soporte
eliersin13
 

Último (6)

PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdfPC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
PC-04-DISEÑOS DE PITS Y STOPES DE UNA MINA A TAJO ABIERTO.pdf
 
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdfIntroducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
Introducción_a_las_APIs_y_Desarrollo_Back-end-Abbie Dominguez Girondo.pdf
 
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptxTECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
TECLADO ERGONÓMICO Y PANTALLAS TACTILES.pptx
 
Arquitectura de Sistema de Reservaciones
Arquitectura de Sistema de ReservacionesArquitectura de Sistema de Reservaciones
Arquitectura de Sistema de Reservaciones
 
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJECONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
CONCEPTOS DE PROGRAMACION CUALQUIER LENGUAJE
 
primer manual de nuestra compañía de soporte
primer manual de nuestra compañía de soporteprimer manual de nuestra compañía de soporte
primer manual de nuestra compañía de soporte
 

Recorrido por el Content Repository API para Java (JCR), analizando JackRabbit

  • 1. Presentador Edwin Guilbert Recorrido por el Content Repository API para Java (JCR), analizando JackRabbit. 20 de Mayo, 2015 JCR
  • 2. ¿QUÉ ES JCR? ! Content Repository API para Java: ! CMS Java Standard: JSR-170, JSR-283 Object database para guardar, buscar y obtener datos jerárquicos Java Package: javax.jcr
  • 3.
  • 4. ¿QUÉ ES JACKRABBIT? ! Implementación de referencia de JCR: ! ! Session Repository Node
  • 5.
  • 6. NODE TYPES ! Define los nodos hijo y sus propiedades. Sirve de modelo de contenidos para aplicaciones: ! Primary type: Estructura del nodo. Propiedades, hijos, herencia ! Mixin: Capacidad con propiedades o nodos hijos
  • 7. Primary: Product <nodeTypes xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl" xmlns:jcr="http://www.jcp.org/jcr/1.0"> <!-- custom node types --> <nodeType name="mgnl:product" isMixin="false" hasOrderableChildNodes="true" primaryItemName=""> <supertypes> <supertype>mgnl:content</supertype> </supertypes> </nodeType> </nodeTypes>
  • 8. Primary: Content <nodeType name="mgnl:contentNode" isMixin="false" hasOrderableChildNodes="true" primaryItemName=""> <supertypes> <supertype>nt:hierarchyNode</supertype> <supertype>mix:referenceable</supertype> <supertype>mgnl:created</supertype> <supertype>mgnl:activatable</supertype> <supertype>mgnl:lastModified</supertype> <supertype>mgnl:renderable</supertype> </supertypes> <childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" sameNameSiblings="false"> <requiredPrimaryTypes> <requiredPrimaryType>nt:base</requiredPrimaryType> </requiredPrimaryTypes> </childNodeDefinition> <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/> <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/> </nodeType>
  • 9. Mixin: Created <nodeType name="mgnl:created" isMixin=“true"> ! <supertypes> <supertype>nt:base</supertype> </supertypes> ! <propertyDefinition name="mgnl:created" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple=“false"/> ! <propertyDefinition name="mgnl:createdBy" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple=“false"/> ! </nodeType>
  • 10. BENEFICIOS DE JCR Estructura Jerárquica Observación Búsqueda Versionado Exportar Importar Ordenamiento Seguridad
  • 11. ESTRUCTURA JERÁRQUICA Los datos en JCR consisten en un árbol de nodos con propiedades asociadas: ! Los datos se almacenan en propiedades Strings o datos binarios Un nodo puede tener uno o mas NodeTypes asociados Propiedad especial que permite referenciar nodos entre sí Herencia/Integridad referencial JCR+API
  • 12. REPOSITORIO Y WORKSPACES ! ! Carpetas comparables con nodos ! Ficheros comparables con propiedades ! Navegación por path: /A/B/property
  • 13.
  • 14. OBSERVACIÓN ! Permite a las aplicaciones recibir notificaciones sobre cambios en un workspace: ! Modelo de eventos Tipos de evento: Agregar, remover, persistir Propiedades de evento: Path, identificador, usuario, fecha
  • 15. ObservationManager:addEventListener ! ObservationUtil.registerDeferredChangeListener( RepositoryConstants.CONFIG, SERVER_FILTERS, filtersEventListener, 1000, 5000); ! ! ObservationManager observationManager = getObservationManager(workspace); ! observationManager.addEventListener(listener, eventTypesMask, observationPath, includeSubnodes, null, nodeTypes, false);
  • 16. EventListener por Workspace ! public class CommandEventListener implements EventListener { ! public void onEvent(EventIterator events) { ! while (events.hasNext()) { ! event = events.nextEvent(); ! path = getPath(event); ! Context executionCtx = this.createContext(); ! executionCtx.put(Context.ATTRIBUTE_PATH, path); ! getCommand().execute(executionCtx); } } }
  • 17. BÚSQUEDA ! JSR-283 establece que se debe soportar una forma estandarizada de SQL: ! Abstract Query Model Lenguajes: JCR-SQL2 y JCR-JQOM Semántica: Selectores, Joins, Constraints, Orderings, Query results JCR Query Cheat Sheet
  • 18.
  • 19. VERSIONADO El versionado permite al usuario guardar y restaurar el estado de un nodo y su sub-árbol: ! Version <mix:versionable> subtipo de <mix:referenceable> Checkin, checkout y checkpoint VersionHistory / VersionStorage Base version Frozen nodes
  • 20.
  • 21. protected Version createVersion(Node node, Rule rule, String userName) throws UnsupportedRepositoryOperationException, RepositoryException { ! node.addMixin(“mix:versionable"); node.addMixin.save(); ! // add version Version newVersion = node.checkin(); node.checkout(); ! } ! BaseVersionManager: createVersion
  • 22. public synchronized void restore(final Node node, Version version, boolean removeExisting) throws VersionException, UnsupportedRepositoryOperationException, RepositoryException { ! ! node.restore(unwrappedVersion, removeExisting); ! node.checkout(); ! ! } BaseVersionManager: restore
  • 23. IMPORTAR / EXPORTAR JCR provee serialización convirtiendo a XML el contenido del workspace sin pérdida de información: ! XML refleja estructura jerárquica de JCR Namespace: sv: http://www.jcp.org/jcr/sv/1.0 Nodos se convierten en <sv:node> Propiedades se convierten en <sv:property> Nombres se convierten en atributo sv:name=“”
  • 24.
  • 25. ! ! ! Session session = ws.getSession(); ! ! session.importXML(basepath, xmlStream, importMode); ! ! session.exportSystemView(basepath, outputStream, false, false); DataTransporter: import export
  • 26. ORDENAMIENTO ! JCR permite que los nodos tengan un ordenamiento dentro del árbol jerárquico: ! Propiedades no son ordenables <nodeType name="mgnl:content" hasOrderableChildNodes=“true"> Node.getNodes() siempre tiene un orden El nodo padre ordena a sus hijos
  • 27. ! ! ! public static void orderBefore(Node node, String siblingName) throws RepositoryException { ! node.getParent().orderBefore(node.getName(), siblingName); ! } ! ! ! NodeUtil: orderBefore
  • 28. SEGURIDAD ! JCR permite la gestión de control de acceso en el repositorio: ! AccessControlManager Privilegios que un usuario tiene sobre un nodo jcr:read Obtener un nodo y sus propiedades jcr:write Modificar propiedades, agregar/eliminar nodos
  • 29. Roles provide fine-grained access controls for both Apps and site URLs
  • 30. public void addPermission(final Role role, final String workspace, final String path, final long permission) { ! Node roleNode = session.getNodeByIdentifier(role.getId()); Node aclNode = getAclNode(roleNode, workspace); if (!existsPermission(aclNode, path, permission)) { String nodeName = Path.getUniqueLabel(session, aclNode.getPath(), "0"); Node node = aclNode.addNode(nodeName, NodeTypes.ContentNode.NAME); node.setProperty("path", path); node.setProperty("permissions", permission); session.save(); } ! } MgnlRoleManager: addPermission