Packager Quick Reference
Package OpenForum pages and attachments for distribution and deployment
Key Features
- Create distributable page packages
- Bundle pages with all attachments
- Export page hierarchies
- Import packages to other OpenForum instances
- Version control for page packages
- Dependency tracking
Server-Side Usage:
// Get the Packager API
var Packager = js.getObject("/OpenForum/AddOn/Packager","Packager.sjs");
// Create package from page
Packager.createPackage("/MyPage", "/Packages/my-package.zip");
// Create package with specific files
Packager.createPackage("/MyPage", "/Packages/my-package.zip", {
includeAttachments: true,
includeChildren: true
});
// Extract package
Packager.extractPackage("/Packages/my-package.zip", "/DestinationPage");
// List package contents
var contents = Packager.listPackageContents("/Packages/my-package.zip");
Client-Side Usage:
// Create package
JSON.post('/OpenForum/AddOn/Packager/Create', null,
'pageName=/MyPage&outputFile=my-package.zip')
.onSuccess(function(result) {
console.log('Package created:', result);
}).go();
// Extract package
JSON.post('/OpenForum/AddOn/Packager/Extract', null,
'packageFile=my-package.zip&destination=/MyPage')
.onSuccess(function(result) {
console.log('Package extracted');
}).go();
Package Format
- ZIP archive containing page.content, data.json, and attachments
- Preserves page structure and metadata
- Includes dependency information
Configuration
- Configure default package location
- Set inclusion/exclusion rules
- Define package metadata