Updating existing OpenCms installations to version 9.5 is straightforward using the provided update wizard.
OpenCms 9.5 provides several new tools in the “Advanced Direct Edit” (ADE) view, allowing content creators to work exclusively in that mode without the need to access the traditional workplace. In addition to this, new user roles have been added to OpenCms that allow more fine grained tuning of content manager permissions.
Michael shows how to introduce these new, optional roles in existing OpenCms installations after an update to version 9.5. Moreover, he explains how to integrate new features such as nested containers or on-the-fly PDF creation. Michael also points out potential pitfalls in the update process, related to changes in the core API that may require adjustments in your code.
2. ●Update your current OpenCms installation to OpenCms 9.5
●Update OpenCms with OCEE
●API changes
●Content Collectors
●SOLR Postprocessor
●Showcase: Enhancing your Application with OpenCms 9.5 features
2
Agenda
4. Good news: Your existing OpenCms 8 or OpenCms 9 webapp will run in OpenCms 9.5 – without any changes
(At least – in most cases….)
4
Update to OpenCms 9.5
5. How to upgrade:
Use the OpenCms update wizard!
5
Update to OpenCms 9.5
7. ●Updating OCEE within a major OpenCms version
●Example: OpenCms 9.0.0 (OCEE 4.0.0) to OpenCms 9.0.1 (OCEE 4.0.1)
-Very Easy
●Simply install the new OCEE modules before updating the OpenCms core
7
Updating OpenCms with OCEE
8. ●Updating OpenCms from one major version to another in a cluster
●Requires more planning to reduce downtimes
●Manual work on config files needed
8
Updating OpenCms with OCEE
9. 9
Updating OpenCms with OCEE
Master
MDB
SDB
Slave 1
Slave 2
●A typical OpenCms/OCEE update scenario
●One master, two slaves, with DB replication
●How to update OpenCms and OCEE?
●Reduce downtime for delivery servers
OCEE-Cluster
OCEE-Cluster
10. 10
Updating OpenCms with OCEE
Master
MDB
SDB
Slave 1
Slave 2
Step 1
●Content Freeze!
●Disable Cluster & Replication
Content delivery from Slave 1 and Slave 2
11. 11
Updating OpenCms with OCEE
Master (9.5)
MDB
Step 2
●Clone Slave DB
●Connect each Slave to its own Database
Content delivery from Slave 1 and Slave 2
SDB 2
Slave 1
Slave 2
SDB
12. 12
Updating OpenCms with OCEE
Master (9.5)
MDB
Step 3
●Direct all traffic to Slave 2
●Shutdown Slave 1
●Uninstall OCEE on master server
●Run Update Wizard on Master Server
●Test Master Server
Content delivery Slave 2
Master Server is updated to OpenCms 9.5
SDB 2
Slave 1
Slave 2
SDB
13. 13
Updating OpenCms with OCEE
Master (9.5)
MDB
SDB 2
Slave 1
Slave 2
Step 4
●Install new OCEE on master
Content delivery from Slave 2
Master Server is updated to OpenCms 9.5
SDB
14. 14
Updating OpenCms with OCEE
Master (9.5)
MDB
SDB 2
Slave 1 (9.5)
Slave 2
Step 5
●Replace all .jar Files on Slave 1
●Adjust configuration files on Slave 1 (if required)
●Enable OCEE Cluster for Master and Slave 1
●Replicate system folder (alternatively: replicate all)
●Rebuild Searchindexes on Slave 1
●Test combination Master and Slave 1
Content delivery from Slave 2
Master Server and Slave 1 are updated to OpenCms 9.5
SDB
15. 15
Updating OpenCms with OCEE
Master (9.5)
MDB
Slave 1 (9.5)
Slave 2 (9.5)
Step 6
●Direct all traffic to Slave 1
●Copy Webapplication from Slave 1 to Slave 2
●Adjust configuration files on Slave 2
●Enable OCEE Cluster for all Server
●Reconnect Slave 2 to Slave DB
●Rebuild Searchindexes on Slave 2
●Test combination Master and Slave 2
●Cancel content freeze
Content delivery from Slave 1
All servers are updated to OpenCms 9.5
SDB
16. 16
Updating OpenCms with OCEE
Master (9.5)
MDB
Slave 1 (9.5)
Slave 2 (9.5)
Step 7
●Direct all traffic to both delivery servers
DONE !
SDB
18. ●Containerpages are now locale independend (like other configuration files)
●Important when using localization & siblings of containerpages (which you should not have done !)
18
API changes
19. ●A few plugable Interfaces have changed in OpenCms 9.5
●But: Don’t panik!
●Code-Changes are minimal and can be done in short time
19
API changes
20. ●Content Collectors collect content items (e.g. News) to display them in a list view
●New method added to Interface I_CmsResourceCollector
●Why changes? Enhancements in the ADE Publish function
20
API changes – Content Collectors
21. ●How to change my own collectors?
●Add additional getResult Method:
21
API changes - Content Collectors
List<CmsResource>
getResults(CmsObject cms,
String collectorName,
String params,
int numResults)
throws CmsException;
22. ●New function in Content Collectors since OpenCms 9.0
●The problem so far: Collectors do not show expired or unreleased content items for editing
●The solution: add the “excludeTimerange” as last value to the parameter string
22
API changes – Content Collectors
param="${newspath}news_%(number).html|news|150|excludeTimerange"
24. ●The Solr PostProcessor allows to manipulate Solr results
●New method added to Interface I_CmsSolrPostSearchProcessor
●Why changes? To allow new options in post-proccessing
24
API changes – Solr PostProcessor
25. 25
API changes – Solr PostProcessor
SOLR Handler
SOLR
Post Processor (Access Check)
Custom Post Processor
Query
Result
Query
Result
26. ●How to change my own post processors?
●Add additional init() method:
●The method is called for each new Solr query
26
API changes – Solr PostProcessor
void init();
27. ●Example use-case: Do only display one sibling in search result
27
API changes – Solr PostProcessor
private Set<CmsUUID> m_processedResources;
public void init() {
m_processedResources.clear();
}
public SolrDocument process(CmsObject searchCms, CmsResource resource, SolrInputDocument document) {
CmsUUID resourceId = resource.getResourceId();
if (!m_processedResources.contains(resourceId)) {
m_processedResources.add(resourceId);
return ClientUtils.toSolrDocument(document);
}
return null;
}
}
29. ●Element views and new roles
●Content editors only see editpoints which they are allowed to see
●PDF-Generation on the fly
●Simple way to produce PDF files from News or other contents
29
Add OpenCms 9.5 features
30. Element views:
●Assign Content Types to Element views
●Assign Users to Element views
Users can only use the Content Types supported by the selected view
Different users have different edit points
30
Element views and roles
31. New OpenCms 9.5 roles:
●So far: Editors had to be “Workplace User”
●Now: Finer subdivision
●Element author
●Editor
●Category Editor
●Gallery Editor
●Workplace user
31
Element views and roles
32. Sample use-case
●2 Views:
●Content View: Edit Articles and branding content
●News View: Edit News
●3 Editors with different views and roles
●Jeb (Editor): Content View, News View
●Bill (Element author): Content View
●Bob (Element author): News View
32
Element views and roles
33. What to do?
●Create the Views
●/elementviews/ folder in Module
●Set permission to views
●Workplace permission dialog
●Assign contents to views
●Module configuration
●Sitemap configuration
33
Element views and roles
34. ●Live Demo
34
Element views and roles
Demo
Demo
Demo
Demo
デモ
35. ●Create PDF-Files from XmlContents
●Write a special PDF template
●Use HTML/CSS for formating the PDF layout
●We need:
●Configuration
●PDF Template
●Create the correct link to the PDF
35
PDF generation on the fly
36. Step 1: Configuration
●ResourceInitHandler must be configured in opencms-system.xml
36
PDF generation on the fly
[…]
<resourceinit>
<resourceinithandler class="org.opencms.pdftools.CmsPdfResourceHandler"/>
[…]
</resourceinit>
[…]
37. Step 2: “PDF-Template
●A complete HTML template, styled by CSS
●Use <cms:contentload> and <cms:contentaccess> to access content
●Like a Formatter or old-style detail JSP
37
PDF generation on the fly
39. Step 3: Integration
●Add a link by using the <cms:pdf> tag
●format: Path to the PDF Template
●content: Filename of the content (e.g. ${content.filename}
●locale: Locale to be displayed
39
PDF generation on the fly
<a href="<cms:pdf format='...' content='...' locale='...'/>" >PDF</a>
40. ●Live Demo
40
PDF generation on the fly
Demo
Demo
Demo
Demo
デモ