SlideShare a Scribd company logo
1 of 33
First Steps with CMIS &
Alfresco
Jeff Potts
@jeffpotts01
http://ecmarchitect.com

#SummitNow
You’ve been handed a project
Your Favorite Language/Framework

What Goes Here?

#SummitNow
#SummitNow
You’ve been handed a project
Your Favorite Language/Framework

#SummitNow
#SummitNow
CMIS gives developers a standard
API for working with content
repositories like Alfresco

#SummitNow
#SummitNow
First Steps with CMIS
1. Choose CMIS as your preferred API
2. Use the OpenCMIS Workbench as a
learning tool
3. Set up your development environment
4. Watch out for gotchas/limitations
5. Take advantage of additional learning
resources
#SummitNow
#SummitNow
Why CMIS?
Preferred API for working with Alfresco
Open standard, managed by OASIS
Many vendors support it
Plenty of examples
Client libraries for many languages
• Java, Python, .NET, PHP, ObjectiveC, Android
#SummitNow
#SummitNow
http://chemistry.apache.org
#SummitNow
#SummitNow
Start with the Workbench

#SummitNow
#SummitNow
Connect with CMIS Workbench

#SummitNow
#SummitNow
Explore the Alfresco repo
CRUD objects
Inspect/change properties
Run queries
Run scripts using the Groovy console
See the content model

#SummitNow
#SummitNow
The Workbench is great for…
Testing queries
Inspecting the data dictionary
• Including whether or not a property is
read/write or queryable
Can I do _____________ with CMIS?

#SummitNow
#SummitNow
Alfresco CMIS Service URLs by Version
Alfresco
Version

CMIS Service URL

3.2r2 - 3.4

http://localhost:8080/alfresco/service/cmis (ATOM)
http://localhost:8080/alfresco/cmis (SOAP)

4.0

http://localhost:8080/alfresco/cmisatom
http://localhost:8080/alfresco/cmis (SOAP)

4.2.d/4.2
Enterprise

http://localhost:8080/alfresco/api/-default-/cmis/versions/1.0/atom
http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom
http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/browser
http://localhost:8080/alfresco/cmis (SOAP)

#SummitNow
#SummitNow
Set Up Your Dev Environment

#SummitNow
#SummitNow
Let’s set up your environment
Could use curl or any other HTTP client, but
why?
Grab OpenCMIS from Apache Chemistry
Maven makes it easy
Group: org.apache.chemistry.opencmis
Artifact: chemistry-opencmis-client-impl
Version: 0.10.0

#SummitNow
#SummitNow
File Loader Example
Let’s load some images into Alfresco onpremise
• Get a session
• Create a folder
• Check-in some documents
• Set some properties
https://code.google.com/p/alfresco-api-java-examples/

#SummitNow
#SummitNow
CMIS Works in the Cloud Too!
Let’s load some images into Alfresco in the
cloud
Same CMIS calls, different authentication
Register for an API key
• http://www.alfresco.com/develop

#SummitNow
#SummitNow
Watch Out for
Gotchas/Limitations

#SummitNow
#SummitNow
CMIS object IDs are opaque

Best not to even
look at one!

#SummitNow
#SummitNow
Queries
CMIS queries are read-only
Do you really need everything?
• select * from cmis:document
Do you really need all rows?
• Use OperationContext to limit

#SummitNow
#SummitNow
Working with Aspects
CMIS 1.0 doesn’t know what an aspect is
• Must use OpenCMIS Extension
CMIS 1.1 calls aspects secondary types
• Add/remove aspects by setting
cmis:secondaryObjectTypeIds
For queries, use a join

#SummitNow
#SummitNow
Adding an aspect (CMIS 1.0)
parameter.put(SessionParameter.OBJECT_FACTORY_CLASS,
"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

if (!doc.hasAspect("P:cm:geographic")) {
doc.addAspect("P:cm:geographic");
System.out.println("Added aspect");
} else {
System.out.println("Doc already had aspect");
}
HashMap<String, Object> props = new
HashMap<String, Object>();
props.put("cm:latitude", 52.513871);
props.put("cm:longitude", 13.391106);
doc.updateProperties(props);

#SummitNow
#SummitNow
Adding an aspect (CMIS 1.1)
List<Object> aspects =
doc.getProperty("cmis:secondaryObjectTypeIds").getValues();
if (!aspects.contains("P:cm:geographic")) {
aspects.add("P:cm:geographic");
HashMap<String, Object> props = new
HashMap<String, Object>();
props.put("cmis:secondaryObjectTypeIds", aspects);
doc.updateProperties(props);
System.out.println("Added aspect");
} else {
System.out.println("Doc already had aspect");
}
HashMap<String, Object> props = new
HashMap<String, Object>();
props.put("cm:latitude", 52.513871);
props.put("cm:longitude", 13.391106);
doc.updateProperties(props);

#SummitNow
#SummitNow
Query for aspect-based props
SELECT D.cmis:name, G.cm:latitude, G.cm:longitude
FROM cmis:document as D
JOIN cm:geographic as G
ON D.cmis:objectId = G.cmis:objectId

#SummitNow
#SummitNow
Working with Relationships
Peer associations only
Both sides must be instances of cmis:folder
or cmis:document or a descendant type

#SummitNow
#SummitNow
Working with ACLs
Can manage ACLs
Cannot set or un-set ACL inheritance

#SummitNow
#SummitNow
Other Limitations
Can only access objects that are
descendants of cm:content or cm:folder
Cannot create users/groups
Cannot create or change types through the
API (yet)
Cannot work with categories or tags

#SummitNow
#SummitNow
A Word About Interoperability
Pay attention to RepositoryInfo
• Multifiling, search, ACL, etc. may differ
between repository vendors
Inspect getAllowableActions
Look at the type definitions
• Not all repositories name types the same
way
#SummitNow
#SummitNow
Example Apps & Additional
Learning Resources

#SummitNow
#SummitNow
Read the Book
Everything you need to know
about CMIS 1.0 & 1.1
Lots of Groovy and Java
examples
Also covers
Python, .NET, PHP, Android, &
iOS
37%-off: 12cmisal
#SummitNow
#SummitNow
Quick Look at The Blend

#SummitNow
#SummitNow
Ask questions in the “Alfresco
API” forum!

#SummitNow
#SummitNow
First Steps with CMIS
1. Choose CMIS as your preferred API
2. Use the OpenCMIS Workbench as a
learning tool
3. Set up your development environment
4. Watch out for gotchas/limitations
5. Take advantage of additional learning
resources
#SummitNow
#SummitNow
#SummitNow

More Related Content

What's hot

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
Amazon Web Services
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Amazon Web Services
 

What's hot (20)

Connecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISConnecting Content Management Apps with CMIS
Connecting Content Management Apps with CMIS
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to Microservices
 
Intro To Alfresco Part 1
Intro To Alfresco Part 1Intro To Alfresco Part 1
Intro To Alfresco Part 1
 
10 Tips Every New Developer in Alfresco Should Know
10 Tips Every New Developer in Alfresco Should Know10 Tips Every New Developer in Alfresco Should Know
10 Tips Every New Developer in Alfresco Should Know
 
Expand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWSExpand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWS
 
Intro to Alfresco for Developers
Intro to Alfresco for DevelopersIntro to Alfresco for Developers
Intro to Alfresco for Developers
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMS
 
How to extend (properly) and old Alfresco Share feature
How to extend (properly) and old Alfresco Share featureHow to extend (properly) and old Alfresco Share feature
How to extend (properly) and old Alfresco Share feature
 
Deploying a secured Flink cluster on Kubernetes
Deploying a secured Flink cluster on KubernetesDeploying a secured Flink cluster on Kubernetes
Deploying a secured Flink cluster on Kubernetes
 
The Alfresco ECM 1 Billion Document Benchmark on AWS and Aurora - Benchmark ...
The Alfresco ECM 1 Billion Document Benchmark on AWS and Aurora  - Benchmark ...The Alfresco ECM 1 Billion Document Benchmark on AWS and Aurora  - Benchmark ...
The Alfresco ECM 1 Billion Document Benchmark on AWS and Aurora - Benchmark ...
 
Continuous delivery and deployment on AWS
Continuous delivery and deployment on AWSContinuous delivery and deployment on AWS
Continuous delivery and deployment on AWS
 
(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale
 
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
 

Similar to Getting Started With CMIS

DEVCON-Alfresco i os mobile application details and design
DEVCON-Alfresco i os mobile application details and designDEVCON-Alfresco i os mobile application details and design
DEVCON-Alfresco i os mobile application details and design
Zia Consulting
 

Similar to Getting Started With CMIS (20)

Dev Con 2011
Dev Con 2011Dev Con 2011
Dev Con 2011
 
DEVCON-Alfresco i os mobile application details and design
DEVCON-Alfresco i os mobile application details and designDEVCON-Alfresco i os mobile application details and design
DEVCON-Alfresco i os mobile application details and design
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
Relational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsRelational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric Apps
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Code
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
Simplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI APISimplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI API
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swift
 
Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401Application Delivery Patterns for Developers - Technical 401
Application Delivery Patterns for Developers - Technical 401
 
Application Delivery Patterns
Application Delivery PatternsApplication Delivery Patterns
Application Delivery Patterns
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
Metaflow: The ML Infrastructure at Netflix
Metaflow: The ML Infrastructure at NetflixMetaflow: The ML Infrastructure at Netflix
Metaflow: The ML Infrastructure at Netflix
 
TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
 
Taking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced ScriptingTaking Your FDM Application to the Next Level with Advanced Scripting
Taking Your FDM Application to the Next Level with Advanced Scripting
 
Cross platform mobile app development with Xamarin
Cross platform mobile app development with XamarinCross platform mobile app development with Xamarin
Cross platform mobile app development with Xamarin
 
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
 
How to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCFHow to Scale Operations for a Multi-Cloud Platform using PCF
How to Scale Operations for a Multi-Cloud Platform using PCF
 

More from Jeff Potts

Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
Jeff Potts
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
Jeff Potts
 

More from Jeff Potts (20)

No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL Templates
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?
 
The Challenges of Keeping Bees
The Challenges of Keeping BeesThe Challenges of Keeping Bees
The Challenges of Keeping Bees
 
Alfresco: What every developer should know
Alfresco: What every developer should knowAlfresco: What every developer should know
Alfresco: What every developer should know
 
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
 
Alfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketAlfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM Market
 
Join the Alfresco community
Join the Alfresco communityJoin the Alfresco community
Join the Alfresco community
 
Intro to the Alfresco Public API
Intro to the Alfresco Public APIIntro to the Alfresco Public API
Intro to the Alfresco Public API
 
Building Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIBuilding Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco API
 
Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
 
Alfresco SAUG: State of ECM
Alfresco SAUG: State of ECMAlfresco SAUG: State of ECM
Alfresco SAUG: State of ECM
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
 
Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011
 
2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results
 
Good Chemistry: Alfresco, JBoss and CMIS
Good Chemistry: Alfresco, JBoss and CMISGood Chemistry: Alfresco, JBoss and CMIS
Good Chemistry: Alfresco, JBoss and CMIS
 
Co-Editing Complex Documents from Alfresco Share
Co-Editing Complex Documents from Alfresco ShareCo-Editing Complex Documents from Alfresco Share
Co-Editing Complex Documents from Alfresco Share
 
The Power of Drupal and Alfresco Together
The Power of Drupal and Alfresco TogetherThe Power of Drupal and Alfresco Together
The Power of Drupal and Alfresco Together
 
Intro To Alfresco Part 2
Intro To Alfresco Part 2Intro To Alfresco Part 2
Intro To Alfresco Part 2
 

Recently uploaded

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 

Recently uploaded (20)

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 

Getting Started With CMIS

  • 1. First Steps with CMIS & Alfresco Jeff Potts @jeffpotts01 http://ecmarchitect.com #SummitNow
  • 2. You’ve been handed a project Your Favorite Language/Framework What Goes Here? #SummitNow #SummitNow
  • 3. You’ve been handed a project Your Favorite Language/Framework #SummitNow #SummitNow
  • 4. CMIS gives developers a standard API for working with content repositories like Alfresco #SummitNow #SummitNow
  • 5. First Steps with CMIS 1. Choose CMIS as your preferred API 2. Use the OpenCMIS Workbench as a learning tool 3. Set up your development environment 4. Watch out for gotchas/limitations 5. Take advantage of additional learning resources #SummitNow #SummitNow
  • 6. Why CMIS? Preferred API for working with Alfresco Open standard, managed by OASIS Many vendors support it Plenty of examples Client libraries for many languages • Java, Python, .NET, PHP, ObjectiveC, Android #SummitNow #SummitNow
  • 8. Start with the Workbench #SummitNow #SummitNow
  • 9. Connect with CMIS Workbench #SummitNow #SummitNow
  • 10. Explore the Alfresco repo CRUD objects Inspect/change properties Run queries Run scripts using the Groovy console See the content model #SummitNow #SummitNow
  • 11. The Workbench is great for… Testing queries Inspecting the data dictionary • Including whether or not a property is read/write or queryable Can I do _____________ with CMIS? #SummitNow #SummitNow
  • 12. Alfresco CMIS Service URLs by Version Alfresco Version CMIS Service URL 3.2r2 - 3.4 http://localhost:8080/alfresco/service/cmis (ATOM) http://localhost:8080/alfresco/cmis (SOAP) 4.0 http://localhost:8080/alfresco/cmisatom http://localhost:8080/alfresco/cmis (SOAP) 4.2.d/4.2 Enterprise http://localhost:8080/alfresco/api/-default-/cmis/versions/1.0/atom http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/browser http://localhost:8080/alfresco/cmis (SOAP) #SummitNow #SummitNow
  • 13. Set Up Your Dev Environment #SummitNow #SummitNow
  • 14. Let’s set up your environment Could use curl or any other HTTP client, but why? Grab OpenCMIS from Apache Chemistry Maven makes it easy Group: org.apache.chemistry.opencmis Artifact: chemistry-opencmis-client-impl Version: 0.10.0 #SummitNow #SummitNow
  • 15. File Loader Example Let’s load some images into Alfresco onpremise • Get a session • Create a folder • Check-in some documents • Set some properties https://code.google.com/p/alfresco-api-java-examples/ #SummitNow #SummitNow
  • 16. CMIS Works in the Cloud Too! Let’s load some images into Alfresco in the cloud Same CMIS calls, different authentication Register for an API key • http://www.alfresco.com/develop #SummitNow #SummitNow
  • 18. CMIS object IDs are opaque Best not to even look at one! #SummitNow #SummitNow
  • 19. Queries CMIS queries are read-only Do you really need everything? • select * from cmis:document Do you really need all rows? • Use OperationContext to limit #SummitNow #SummitNow
  • 20. Working with Aspects CMIS 1.0 doesn’t know what an aspect is • Must use OpenCMIS Extension CMIS 1.1 calls aspects secondary types • Add/remove aspects by setting cmis:secondaryObjectTypeIds For queries, use a join #SummitNow #SummitNow
  • 21. Adding an aspect (CMIS 1.0) parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); if (!doc.hasAspect("P:cm:geographic")) { doc.addAspect("P:cm:geographic"); System.out.println("Added aspect"); } else { System.out.println("Doc already had aspect"); } HashMap<String, Object> props = new HashMap<String, Object>(); props.put("cm:latitude", 52.513871); props.put("cm:longitude", 13.391106); doc.updateProperties(props); #SummitNow #SummitNow
  • 22. Adding an aspect (CMIS 1.1) List<Object> aspects = doc.getProperty("cmis:secondaryObjectTypeIds").getValues(); if (!aspects.contains("P:cm:geographic")) { aspects.add("P:cm:geographic"); HashMap<String, Object> props = new HashMap<String, Object>(); props.put("cmis:secondaryObjectTypeIds", aspects); doc.updateProperties(props); System.out.println("Added aspect"); } else { System.out.println("Doc already had aspect"); } HashMap<String, Object> props = new HashMap<String, Object>(); props.put("cm:latitude", 52.513871); props.put("cm:longitude", 13.391106); doc.updateProperties(props); #SummitNow #SummitNow
  • 23. Query for aspect-based props SELECT D.cmis:name, G.cm:latitude, G.cm:longitude FROM cmis:document as D JOIN cm:geographic as G ON D.cmis:objectId = G.cmis:objectId #SummitNow #SummitNow
  • 24. Working with Relationships Peer associations only Both sides must be instances of cmis:folder or cmis:document or a descendant type #SummitNow #SummitNow
  • 25. Working with ACLs Can manage ACLs Cannot set or un-set ACL inheritance #SummitNow #SummitNow
  • 26. Other Limitations Can only access objects that are descendants of cm:content or cm:folder Cannot create users/groups Cannot create or change types through the API (yet) Cannot work with categories or tags #SummitNow #SummitNow
  • 27. A Word About Interoperability Pay attention to RepositoryInfo • Multifiling, search, ACL, etc. may differ between repository vendors Inspect getAllowableActions Look at the type definitions • Not all repositories name types the same way #SummitNow #SummitNow
  • 28. Example Apps & Additional Learning Resources #SummitNow #SummitNow
  • 29. Read the Book Everything you need to know about CMIS 1.0 & 1.1 Lots of Groovy and Java examples Also covers Python, .NET, PHP, Android, & iOS 37%-off: 12cmisal #SummitNow #SummitNow
  • 30. Quick Look at The Blend #SummitNow #SummitNow
  • 31. Ask questions in the “Alfresco API” forum! #SummitNow #SummitNow
  • 32. First Steps with CMIS 1. Choose CMIS as your preferred API 2. Use the OpenCMIS Workbench as a learning tool 3. Set up your development environment 4. Watch out for gotchas/limitations 5. Take advantage of additional learning resources #SummitNow #SummitNow

Editor's Notes

  1. Alfresco Public API (CMIS++)CMISWeb scripts marked “Public”Custom web scripts
  2. Developer tools, client-side and server-side libraries
  3. The OpenCMIS Workbench answers that question. If you can do it in the Workbench, you can do it with the CMIS API
  4. I see lots of people hitting the bindings directly in the forums and on stack. Why do that when there are perfectly good client libraries available?
  5. Why are you selecting *? Do you really need every single property? If not, list the ones that you need. Do you really need all rows? Add a where clause and/or use an OperationContext to limit what comes back
  6. Similar to https://gist.github.com/jpotts/6136702
  7. https://gist.github.com/jpotts/7242070
  8. Similar to https://gist.github.com/jpotts/6810785