opencmsdays 2013 - using opencms 9 folders as a network drive

16
Georg Westenberger, Alkacon Software Workshop Track Using OpenCms 9 folders as a network drive 09.10.2013

Upload: alkacon-software-gmbh

Post on 18-Nov-2014

1.222 views

Category:

Technology


4 download

DESCRIPTION

OpenCms 8.5 added the CMIS interface that allows standardized access to the contents located in the OpenCms repository. OpenCms 9 takes the concept of standardized access to the repository one step further by allowing OpenCms folders to be mounted as Windows (or Samba) shared network drives. With OpenCms 9 shared folders, content managers can manage images and documents in the OpenCms repository simply on their local desktop. This is especially appealing if OpenCms is used in the Intranet. In this workshop, Georg will show how to set up OpenCms folders so that they can be shared with Windows. He will also explain how to access and manage resources in an OpenCms module directly from an IDE such as Eclipse.

TRANSCRIPT

Page 1: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

Georg Westenberger, Alkacon Software

Workshop Track

Using OpenCms 9 folders

as a network drive

09.10.2013

Page 2: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Basics of network shares

● Setting up OpenCms for network share access

● Using OpenCms network shares for module

development

2

Overview

Page 3: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Network shares (SMB) allows users to connect

to remote file systems and use them as if they

were a „normal“ file system on their computer

● no special client programs necessary!

● Used natively by Windows

● Can also connect from other OSes (e.g. with

fs-cifs on Linux)

● OpenCms 9 can expose (part of) its VFS as a

network share

3

Network share basics

Page 4: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

SMB CMIS

Distinct protocol on port 445 Web service (over HTTP)

Simple data model (like a

„normal“ PC file system)

Richer data model (resource

types, properties, searches…)

OS/driver support Can use

any program to access files

Special clients must be used

For template developers or

other users who want to edit

plain text or binary resources.

For programmers wanting to

access OpenCms file system

functions as a web service

4

SMB vs. CMIS

Page 5: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Live Demo

5

Live Demo

Demo

Demo Demo

Demo

デモ

Page 6: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● SMB: Not running over HTTP, but uses its own

port (445)

● No other process or thread must be listening on

port 445

● Can‘t use multiple OpenCms instances with network

shares on the same server

● Can‘t use e.g. Samba on the same server as OpenCms

when using network shares

● You may need to change your network

configuration (Firewalls, etc.)

6

Server setup

Page 7: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Depending on the server‘s OS, copy WEB-

INF/config/jlanConfig.xml.{linux,windows} to

jlanConfig.xml

● Windows 7: Disable „Server“ service and

restart to free up port 445

● Linux: Default configuration for Linux uses port

1445 (because special permissions are needed

for ports below 1024)

● Forward port 445 to 1445 (e.g. using socat or

iptables)

7

Server setup (2)

Page 8: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

<repository name=“MYSHARE" class="org.opencms.jlan.CmsJlanRepository">

<params>

<!– Make all modifications in the Offline project. -->

<param name="project">Offline</param>

<!– Mount the /system/modules folder -->

<param name="root">/system/modules</param>

<!– Do not add byte order marks -->

<param name="addBOM">false</param>

<param name="wrapper„>

org.opencms.file.wrapper.CmsResourceWrapperReplaceDeleted

</param>

</params>

</repository>

8

Configuring shares in opencms-

importexport.xml

Page 9: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● When the network drive is connected, you can

use e.g. Eclipse to edit resources in OpenCms

directly

● You don‘t need to use the OpenCms code

editor

● Use „linked folders“ in Eclipse to reference

network shares in your Eclipse project

● No need for switching sites after changing files

when trying out if the changes work

9

Template development using

Eclipse with a network share

Page 10: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Live Demo

10

Live Demo

Demo

Demo Demo

Demo

デモ

Page 11: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Connect to \\hostname\SHARENAME (Windows)

or smb://hostname/SHARENAME

● Users can log in using their normal OpenCms

user name / password

● OpenCms permissions apply

● Connecting to a share requires „View“

permissions on the configured root folder

● Users can‘t see resources for which they don‘t

have „View“ permissions

11

Authentication and permissions

Page 12: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● As a workplace replacement

● No functions like Undo, Publish, setting

permissions

● To edit XML content

● Use the Acacia editor in OpenCms instead

● Over the internet

● Protocol requires low-latency network to work

efficiently

12

When/how not to use OpenCms

network shares

Page 13: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Network shares have no concept of file types or properties

● File types for new files are determined by extension

● Copying is different from copying in the workplace; more like downloading and re-uploading

● No concept of properties, either

● Wrapper class: ● org.opencms.file.wrapper.CmsResourceWrapperPropertyFile

● Edit properties and resource files through special „virtual“ files

13

Properties and resource types

Page 14: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Live Demo

14

Live Demo

Demo

Demo Demo

Demo

デモ

Page 15: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

● Any Questions?

15

Any Questions?

Fragen? Questions ?

Questiones?

¿Preguntas? 質問

Page 16: OpenCmsDays 2013 - Using OpenCms 9 folders as a network drive

Georg Westenberger

Alkacon Software GmbH

http://www.alkacon.com

http://www.opencms.org

Thank you very much for your

attention! 16