]project-open[ Package Manager

10
The Package Manager The ]project-open[ Data-Model , Frank Bergmann, 2010-10- 05 This tutorial explains the package manager and the life cycle of packages.

description

This tutorial explains the life cycle of packages in ]project-open[ and how you can use the package manager to install, update and uninstall packages.

Transcript of ]project-open[ Package Manager

Page 1: ]project-open[ Package Manager

The Package ManagerThe ]project-open[ Data-Model , Frank Bergmann, 2010-10-05

This tutorial explains the package manager and the life cycle of packages.

Page 2: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 2

The Package Manager GUI Example

The Package Manager allows to install, update and uninstall packages.

Page 3: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 3

What is a Package?

A package is the basic unit of application code in ]project-open[/OpenACS

]project-open[ consists of some 200 separate packages.

Packages can be installed and uninstalled. A package consists of:

– Meta-information including package version, dependencies and the “mount” URL

– A data-model including tables, PL/SQL functions etc.

– A number of TCL Web-pages– A library with TCL functions

Page 4: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 4

Package Lifecycle

Download:Most packages are part of the ]project-open[ “standard distribution” that you can download from SourceForge.net. Packages are stored in the ~/packages/ (C:\project-open\ servers\ projop\ packages\) directory.

Installation:Please use the Package Manager (see below) for installing a package. During installation, the Package Manager will execute the data-model creation script and “mount” the package.

Update:After updating the package code in /packages/, you run the Package Manager in order to apply changes in the data-model (“upgrade scripts”).

Uninstall:You can uninstall a package if no other packages depend on it. During the uninstall, the Package Manager will execute the data-model delete script.

InstalledInstall

Package

UpdatePackage

UninstallPackage

Start EndDownloadPackage

Page 5: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 5

Anatomy of the “Notes” Package

A package consists of several files and directories with specific conventions for the names of files and folders

You need to stick to the conventions, otherwise the package manager won’t recognize your files.

/packages/intranet-notes/ # Package directoryintranet-notes.info # Meta information/catalog/ # Localization strings

intranet-notes.en_US.ISO-8859-1.xml # US English stringsintranet-notes.de_DE.ISO-8859-1.xml # German strings

/sql/postgresql/ # Data-modelintranet-notes-create.sql # Data-model installation scriptintranet-notes-delete.sql # Data-model delete script

/tcl/ # TCL Libraryintranet-notes-procs.tcl # *-procs.tcl is a library

/www/ # TCL Web-Pagesindex.tcl # TCL logic for index pageindex.adp # ADP (=HTML) content for index page

Page 6: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 6

Package Dependencies

The Package Manager allows developers to specify package dependencies.

The Package Manager may warn the user before installing users with unsatisfied dependencies or offer to install missing packages.

The “.info” package Meta-information file contains two elements for specifying dependencies:– Provides:

Determines the package name and version provided by the current package

– Requires:Specifies dependencies on other packages and a minimum version of these packages. There may be more then one “requires” line per package.

<provides url="intranet-notes" version="3.4.1.0.8"/><requires url="intranet-core" version="3.4.0.0.0"/>

(Excerpt from /packages/intranet-notes/intranet-notes.info)

Page 7: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 7

Package Manager Parameters

The Package Manager allows you to define “parameters” for every package.

Parameters definitions and default values are stored in the “.info” file with package meta-information.

The package manager will read the parameter definitions into the database during package installation.

The ]po[ Admin -> Parameters page allows you to modify parameter values.

The screenshot at the right shows an excerpt from intranet-core.info with two parameters of different type (string and number).

You can define new parameters in the Package Manager -> <your package> -> Parameters. Please make sure your .info file is writable, as the PM will write the new parameter right into the file.

Please observe the conventions used in other parameter definitions.

<parameters><parameter

datatype="number" min_n_values="1" max_n_values="1" name="AuditProjectUpdatesP" default="0" description="Enable Auditing?"  

/><parameter

datatype="string" min_n_values="1" max_n_values="1" name="BackupBasePathUnix" default="/home/ppm/filestorage/backup" description="Path for backup sets"

/> [...]</parameters>

(Excerpt from /packages/intranet-core/intranet-core.info)

Page 8: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 8

Writing Package Updates

The Package Manager allows to “update” packages:– The PM will include your package with

an “update” status íf specify a “higher” version number in your .info file then the version stored by the PM

– The PM will check

Page 9: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 9

Notes and Learned Lessons

In OpenACS 5.1 (]po[ V3.4 and below) the Package Manager does not correctly work with version numbers with double-digit versions (like 3.4.0.7.11). Please keep version numbers single-digit.

Page 10: ]project-open[ Package Manager

]project-open[ 2010, Data-Model / Frank Bergmann / 10

Frank [email protected]

www.project-open.com